0
votes

I have my web application deployed in tomcat. Right now its accessed using the IP in the URL.

http://IPaddress:8080/appname/index.html

I wanted to configure a domain name in the DNS server which maps to this IP name. My windows admin created a domain. But problem is I'm not able to use it directly. Its expecting the port number.

http://domain.com:8080/appname/index.html

My expectation :

http://domain.com --> http://IP:8080/appname/index.html

How do I configure so that my tomcat recognizes the domain name with out the port number.

3
You can't do this with just DNS. You would need a proxy or a redirector to do this; something has to be listening on port 80 for HTTP to "just work" without a port number, either you or something fronting your application. - Joe
@satish jonnala i want to do the same have you got any way to do this - Prikshit

3 Answers

0
votes

You have to change port from 8080, to 80. See https://stackoverflow.com/a/4758356/841176 for instructions.

0
votes

Probably you need to do a port forwarding on the router. Tell your admin that any requests coming to domain.com (IP) should be redirected to IP:8080 instead of IP:80

0
votes

It's common to run Apache in front of Tomcat which could forward incoming port 80 requests to port 8080. You'd need to enable the mod_proxy module in Apache and then you can configure Apache to forward the requests - something like this:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

ProxyPass         /appname  http://IPAddress:8080/appname
ProxyPassReverse  /appname  http://IPAddress:8080/appname

Then requests to http://domain.com/appname will be forwarded to http://IPAddress:8080/appname.

See the mod_proxy docs for more info.