6

I have tomcat5 installed on CentOS. which is configured to listen only from 127.0.0.1. How do I configure Tomcat to listen from all interfaces.

Connector port config is as under:

 <Connector port="8080" protocol="HTTP/1.1" 
       connectionTimeout="20000" 
       URIEncoding="UTF-8"
       address="0.0.0.0"
       redirectPort="8443" />
  • Can you show us the output of iptables -L ? – Zypher Apr 3 '12 at 17:34
7

You need to change the connector stanza in your server.xml file.

<Connector port="8080" protocol="HTTP/1.1" 
           connectionTimeout="20000" 
           URIEncoding="UTF-8"
           address="0.0.0.0"
           redirectPort="8443" />

You need to add/change the address attribute. Don't forget to restart your tomcat server after that.

| improve this answer | |
  • changed as you advised. still i am unable to access tomcat – Asghar Apr 3 '12 at 14:24
  • I can't see the address attribute in your connector. – Khaled Apr 3 '12 at 14:24
  • added the address attribute. but still having the same problem.. – Asghar Apr 3 '12 at 14:30
  • @Asghar Did you restart the service after making the change? Can you confirm which address it's listening on with netstat? – Shane Madden Apr 3 '12 at 16:29
  • 1
    address="0.0.0.0" mean listen on all interfaces – Zypher Apr 3 '12 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.