Tomcat – Configure an IP address instead of localhost:8080 tomcat eg:192.260.0.2:8080

javatomcat

Can anyone suggest me how to configure my localhost:8080 in tomcat to connecting to an IP address instead of localhost such that i access my localhost in any system in my workplace… i am using tomcat6 and netbeans 6.9.1

Best Answer

Your question is ambiguous dude.

If you are asking how you can make the hostname "localhost" resolve to something other than 127.0.0.1 then the answer is:

  • change the localhost entry in your "/etc/hosts" file, and mess with the network configs, and
  • DON'T DO IT because you are liable to break things.

If you are asking how to get Tomcat to accept requests on some other IP address, then the answer is to edit the $CATALINA_HOME/conf/server.xml to add or change the relevant <Connector> element. Of course, you can only listen on the configured IP address or addresses of your computer's network interface / interfaces.