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" />
1
  • Can you show us the output of iptables -L ?
    – Zypher
    Apr 3, 2012 at 17:34

1 Answer 1

6

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .