• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why my application on Tomcat works only with localhost?

 
dariyoosh za
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dariyoosh za wrote:it doesn't work and the very same page cannot be found


Do you have exact error message?
 
eric whitmore
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic