aspose file tools*
The moose likes Tomcat and the fly likes Why my application on Tomcat works only with localhost? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Why my application on Tomcat works only with localhost?" Watch "Why my application on Tomcat works only with localhost?" New topic
Author

Why my application on Tomcat works only with localhost?

dariyoosh za
Greenhorn

Joined: Apr 12, 2009
Posts: 20
Dear all,


I have a question about using different hostnames in Tomcat. Currently I have a JSP/Servlet application that works pretty well with localhost as the hostname.
However, it seems that my application works only with localhost and not the hostname of my computer. For example if I write:



I can see the default Apache Tomcat page. However, if I use my computer hostname, which is DSTI-72001714, instead of localhost, that is,

it doesn't work and the very same page cannot be found. I don't really understand, because this hostname is valid and I can ping it from any computer in our
enterprise (including the localhost), therefore principally there is no DNS problem.

Any idea? What may I have forgotten during Apache Tomcat configuration causing this problem?


Thanks in advance,
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
dariyoosh za wrote:it doesn't work and the very same page cannot be found


Do you have exact error message?
eric whitmore
Greenhorn

Joined: Feb 16, 2010
Posts: 4
You need to update your tomcat server.xml file if your going to use v.hosts. Basically you have to tell tomcat that you want http://DSTI-72001714 to point to the localhost. You can do this by modifying the following lines in your server.xml:



becomes



You can also add logging by adding this code between the host tags:


Hope this helps.
dariyoosh za
Greenhorn

Joined: Apr 12, 2009
Posts: 20
Hello


Thank you very much both of you for your attention to my problem. Finally It had nothing to do with tomcat configuration. The problem was that I had not
activated the "Web Proxy Auto-Discovery" in firefox. In our enterprise we have two proxy servers, one is used for the internet and the second one for
the hostname resolution of the enterprise workstations. I had set manually only the internet proxy, as a result the browser could not resolve the hostname.
But after activating "Web Proxy Auto-Discovery", both proxies became available, and the application worked pretty well also with the specified hostname.

Once again, thanks for your answers.


Kind Regards
Dariyoosh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why my application on Tomcat works only with localhost?