• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat 6 and DNS Lookup

 
Anirban Chowdhury
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
I am running a web application on Tomcat 6.0.32 on CentOS 5 system. I have already got a domain (say abcd.sg) registered . Now, how do I go about mapping the domain to my webapplication. Currently, my webapplication will open up like
http://xx.xxx.xxx.xxx:8080/webappname

I want it to be redirected from abcd.sg..
I have tried the virtual hosting options like below in server.xml, but it did not work out.


Could somebody please light the way a bit!! I googled a lot, but couldn't get a satisfactory answer.

Thanks a lot in advance.
Anirban


Thanks & Regards,
Anirban


 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "redirected"? Does the Tomcat run on the IP address pointed to by the DNS entry for your domain name?
 
Anirban Chowdhury
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,
Thank you for the response.
1. As of now, only a DNS name has been registered ( abcd.sg). It does not have an IP address mapped to it.
2. I have a Tomcat running @ xx.xxx.xxx.xxx:8080 and if I hit the URL http://xx.xxx.xxx.xxx:8080/webappname , it shows my website.
3. How or rather where do I map the IP to the DNS? Can I do it on my own, or do I have to go back to the DNS registrars for doing it?


Thanks & Warm Regards,
Anirban Chowdhury


 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<eidt>deleted my post. since it wont help OP</edit>
 
Anirban Chowdhury
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seetharaman Venkatasamy wrote:[not sure]change the port number to 80 from 8080 and then try!


It's not going to work, as I already have an Apache Web Server running on 80, and anyway the IP mapping is not done. It has to be done somewhere , I am sure

 
Tim Holloway
Saloon Keeper
Pie
Posts: 17995
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DNS resolves ONLY IP addresses. Not port numbers.

Port number selection is done by the client (browser). The standard/default ports that a browser will pick when not given a URL that includes an explicit port number are 80 (http) and 443 (https).

To get a simple URL to be routed to port 8080 you need server-side help to translate from the port-70/443 or port 8080/8443 (or whatever). The most common approach is to front-end Tomcat with a general-purpose webserver such as Apache and let Apache proxy things. You can also use an http proxy server such as Squid.

If the Tomcat webapp has its own distinct IP address, various routing tricks can be used - either by programming the port redirection in the router that feeds Tomcat or by using an internal system such as Linux' IPTABLES.
 
Anirban Chowdhury
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,
Thanks for the comments. Ok, if I have understood correctly, I would have to configure the port correctly, via Tomcat/Apache so that if I hit abcd.sg it will route to only xx.xxx.xxx.xxx:80 as the site is http. But where / how do I map abcd.sg = xx.xxx.xxx.xxx ?

Thanks & Warm Regards,
Anirban.

PS: I contacted the hosting service providers , and they told me that the IP can be mapped easily via Plesk , which I do not want to be installed as then I have to re-install mySQL and other dependant s.w. Any ideas folks?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic