I have a Java based webapplication hosted on a local Tomcat server. As of now, I am accessing it with a URL like http://localhost:8080/myApp. But I want to access it with a domain name, something like http://us.localApp.com/myApp. Simlilary I want other’s machines, which are on the network, to access it by this domain URL only. Do I have to make the changes in my application or Tomcat settings for this or do I need to mention just
an entry like 127.0.0.1 us.localApp.com in my hosts file.
I can see this entry in appConfig.xml and also saw some people accessing with localApp.com <!ENTITY appDomain "localApp.com">, but how should I go about it?
I have made the entry 127.0.0.1 google.com in the hosts file. When I type http://google.com I expect it redirect to the local application, that is, my application, but still it is going to the Google site. Why?
The hosts file is the easiest way I can think of, but it will need to be implemented locally on each machine. The alternative would be to install a local DNS server on your network and route that specific DNS request to your application server.