File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Accessing Tomcat  using etc\host Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Accessing Tomcat  using etc\host" Watch "Accessing Tomcat  using etc\host" New topic
Author

Accessing Tomcat using etc\host

Richard Muller
Greenhorn

Joined: May 05, 2002
Posts: 14
I can access Tomcat on my workstation through http://localhost:8080 on IE6 over Win2000ProSP2.
I found the etc\hosts file which maps localhost to 127.0.0.1.
I added Tomcat mapped to 127.0.0.1:8080 and tried:
http://Tomcat
This didn't work -- I get the usual:
The page cannot be displayed
Any ideas how I can do this.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15629
    
  15

Yes. Don't do that. 127.0.0.1 should ALWAYS be named "localhost". All sorts of things could break otherwise. In Windows, it may even be hardcoded and ignoring etc\hosts or lmhosts. On any event, unless Win2K has done something uniquely wierd, you can't attach a port ID to a host IP that way anyhow.
If you don't like "http://127.0.0.1:8080" or http://localhost:8080", you can always use the machine's LAN name (look in "My Network Places"). Or get someone to set you up with DNS. However, you STILL have to give the port name, since "http://anything" without a port means Port 80.
If you don't like 8080, shut down whatever webserver might be running there (e.g. IIS) and set up the Tomcat server.xml file to serve at Port 80. Either that, or set up the Port 80 server to pipe to Tomcat the way it's done with an Apache/Tomcat or IIS/Tomcat pairing.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing Tomcat using etc\host
 
Similar Threads
Tomcat is not running?
help me!
starting problem of tomcat
Problem getting Servlets to work correctly with Tomcat
http://localhost:8080 not working but http://127.0.0.1 is working