【问题标题】:How to set the Maximum HTTP Parameter Count on JBoss 5.1.0.GA?如何在 JBoss 5.1.0.GA 上设置最大 HTTP 参数计数?
【发布时间】:2014-02-22 19:22:39
【问题描述】:

我想为 JBoss 5.1 设置 org.apache.tomcat.util.http.Parameters.MAX_COUNT 属性。 我正在按照以下方式进行操作,但它没有受到影响。请任何人帮助使用正确的语法在 properties-service.xml 文件中添加此属性?

<attribute name="Properties">
    org.apache.tomcat.util.http.Parameters.MAX_COUNT=2
</attribute>

【问题讨论】:

    标签: jboss jboss5.x


    【解决方案1】:

    由于您尝试更改的设置是针对嵌入在 JBoss 服务器中的 Tomcat,因此您必须更改 Tomcat 配置中的设置。在 JBoss-5.1.0.GA 上,该文件名为:server.xml,并且可以在 Tomcat 配置目录中找到(假设您位于 jboss-5.1.0.GA 根目录中):/server/default/deploy/jbossweb.sar。如果您没有使用default 目录来部署您的应用程序,请将路径中的default 替换为:allminimalstandardweb 或您正在使用的任何内容。

    server.xml 中,您想要找到 Service 配置条目(在默认配置中的第 9 行)并在该条目中找到 @987654331 的 Connector 配置条目@ 协议连接器(默认配置中的第 12 行)。您可以使用通用连接器配置属性:maxParameterCount 来设置将被解析的请求参数的最大数量(包括 GETPOST 请求)。

    从默认的HTTP连接器配置开始:

    <Service name="jboss.web">
        <Connector protocol="HTTP/1.1" port="8080"
                    address="${jboss.bind.address}"
                    connectionTimeout="20000" redirectPort="8443" />
    

    您将添加maxParameterCount 属性以具有:

    <Service name="jboss.web">
        <Connector protocol="HTTP/1.1" port="8080"
                    address="${jboss.bind.address}"
                    connectionTimeout="20000" redirectPort="8443"
                    maxParameterCount="2" />
    

    如果您想对HTTPS/SSL/TLS 连接器进行相同的配置更改,您还需要更改该协议连接器配置条目(默认配置中的第 25 行)。

    从默认的HTTPS/SSL/TLS 连接器配置开始:

    <Connector protocol="HTTP/1.1" SSLEnabled="true" 
           port="8443" address="${jboss.bind.address}"
           scheme="https" secure="true" clientAuth="false" 
           keystoreFile="${jboss.server.home.dir}/conf/chap8.keystore"
           keystorePass="rmi+ssl" sslProtocol = "TLS" />
    

    您将添加maxParameterCount 属性以具有:

    <Connector protocol="HTTP/1.1" SSLEnabled="true" 
           port="8443" address="${jboss.bind.address}"
           scheme="https" secure="true" clientAuth="false" 
           keystoreFile="${jboss.server.home.dir}/conf/chap8.keystore"
           keystorePass="rmi+ssl" sslProtocol = "TLS"
           maxParameterCount="2" />
    

    【讨论】:

    • maxParameterCount 在 JBoss EAP 6.3 中不被支持。还有其他可用的修复方法吗?
    【解决方案2】:

    您确定将其放入正确的 mbean 中吗?这对我有用,它看起来和你的差不多。

    <mbean code="org.jboss.varia.property.SystemPropertiesService" 
         name="jboss:type=Service,name=SystemProperties">
    
        <attribute name="Properties">
                      org.apache.tomcat.util.http.Parameters.MAX_COUNT=10000
        </attribute>
    </mbean>
    

    【讨论】:

      【解决方案3】:

      对于 JBoss 6.3,这对我有用,

      在standalone.xml 文件中添加以下条目

      ...
      </extensions>
      
      <system-properties>
          <property name="org.apache.tomcat.util.http.Parameters.MAX_COUNT" value="5000"/>
      </system-properties>
      
      <management>...
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-12-18
        • 1970-01-01
        • 1970-01-01
        • 2013-01-01
        • 2011-06-02
        • 1970-01-01
        • 2023-03-09
        • 1970-01-01
        相关资源
        最近更新 更多