- maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
- enableLookups="false" redirectPort="8443" acceptCount="100"
- connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8"
- />
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8"
/>
添加 address="0.0.0.0" ,修改后如下:
- maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
- enableLookups="false" redirectPort="8443" acceptCount="100"
- connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8"
- />
<Connector port="8080" maxHttpHeaderSize="8192" address="0.0.0.0"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8"
/>
此问题的根本原因是tomcat5.5启动时,如果检测到系统支持IPV6,那么默认监听的是IPV6地址的端口,导致通过IPV4无法访问。
使用address="0.0.0.0"的意思是监听IPV4协议栈下的任意IP地址。
IPV4协议监听任意地址应配置 0.0.0.0
IPV6协议监听任意地址应配置 0:0:0:0:0:0:0:0
据查,tomcat6之后此问题已不存在,默认监听的是IPV4地址端口。