我想设置org.apache.tomcat.util.http.Parameters.MAX_COUNT
JBoss 5.1 的属性。
我正在按照以下方式进行操作,但它没有受到影响。请任何人都可以帮助使用正确的语法在 properties-service.xml 文件中添加此属性?
<attribute name="Properties">
org.apache.tomcat.util.http.Parameters.MAX_COUNT=2
</attribute>
最佳答案
由于您尝试更改的设置是针对嵌入在 JBoss 服务器中的 Tomcat,因此您必须更改 Tomcat 配置中的设置。在 JBoss-5.1.0.GA 上,该文件名为:server.xml
并且可以在 Tomcat 配置目录中找到(假设您在 jboss-5.1.0.GA 根目录中):/server/default/deploy/jbossweb.sar
.如果您不使用 default
部署应用程序的目录,替换 default
在路径中:all
, minimal
, standard
, web
,或者你正在使用的任何东西。
在 server.xml 中,您希望找到 Service
配置条目(在默认配置的第 9 行)并在该条目中找到 Connector
HTTP
的配置条目协议(protocol)连接器(默认配置中的第 12 行)。您可以使用通用连接器配置属性设置将被解析的请求参数的最大数量(包括 GET
和 POST
请求):maxParameterCount
.
从默认 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
进行相同的配置更改连接器,您还需要更改该协议(protocol)连接器配置条目(默认配置中的第 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" />
关于jboss - 如何在 JBoss 5.1.0.GA 上设置最大 HTTP 参数计数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21457363/