Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

migrated from Dec 18 '10 at 6:54

This question came from our site for professional and enthusiast programmers.

For the record, is an invalid IP. – Alex Brault Dec 18 '10 at 5:42
Alex i meant similar to it.... i know its a invalid IP – dude Dec 18 '10 at 5:46
Which operating system ? – Iain Dec 18 '10 at 8:51
up vote 4 down vote accepted

Your question is ambiguous dude.

If you are asking how you can make the hostname "localhost" resolve to something other than 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 of 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.

share|improve this answer
@Stephen thanks mate... working finally – dude Dec 18 '10 at 5:53
@dude: Good; please accept the answer by clicking the tick mark icon on this post. – Sanjay T. Sharma Dec 18 '10 at 6:05

Tomcat by default binds to all IP addresses (

Check your inbound firewall rules next. 8080 or whatever port you're using may be blocked.

share|improve this answer

This is the general method for nearly any (non-microsoft) service:

  1. Go through your configuration files for the service in question, and locate any references to either "localhost" or "".
  2. Ponder for a moment about the wisdom of giving anybody unrestricted access to the service.
  3. Change the reference to reflect your external ip address or dns name.

You might need to change network routes on any gateways or routers that may exist between you and "everyone else".

share|improve this answer
@Arafangion - in this case, he probably needs to do it differently than this. While he says "instead of", he probably doesn't really want to stop his Tomcat from listening on (Why would you?) – Stephen C Dec 18 '10 at 6:47

You just need to use the IP of the machine, e.g. your dev machine is, then in the other computer type, remember to check firewall rules

share|improve this answer
That will only work if the service is listening on that IP address. – Arafangion Dec 18 '10 at 5:49

So if I understand you, you want to remotely access your Tomcat which runs locally on port 8080?

You need to know the IP address of your machine first;

windows: - open a dos box - type:

ipconfig /all

linux: - go to shell - type

if config

Your local IP address is listed. Now on your remote (at work) machine's browser enter the following URL:


If there are no firewalls blocking or other network problems you will see your tomcat page.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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