Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Why my application on Tomcat works only with localhost?

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Well behaved women rarely make history - Eleanor Roosevelt. tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic