Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 stackoverflow.com Dec 18 '10 at 6:54

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

    
For the record, 192.260.0.2 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

5 Answers 5

up vote 3 down vote accepted

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 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 (0.0.0.0)

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 "127.0.0.1".
  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 127.0.0.1. (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 10.0.0.100, then in the other computer type 10.0.0.100:8080, 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:

http://the-IP-address-you-found:8080

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

share|improve this answer

Your Answer

 
discard

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.