Sorry if this question makes no sense (no expert here), but I understand that tomcat listens to port 8080 and that url are usually addressed to 80. Is there a way to tell DNS that urls should point to 8080? Or how should I solve this issue?

link|improve this question

possible duplicate of Directing DNS to different ports – mailq Sep 19 '11 at 18:41
feedback

4 Answers

up vote 4 down vote accepted

DNS doesn't know anything about ports. If you want to have tomcat listen on port 8080 then you have a couple of options. The first is to user the port number in the URL

http://example.com:8080/

If you don't like to look of that then you can use your webserver as a port proxy e.g in Apache you can use mod_proxy

<VirtualHost *:80>
        ServerName      example.com
        ProxyRequests Off
        <Proxy *>
                Order deny,allow
                allow from all
        </Proxy>
        ProxyPreserveHost On
        ProxyPass / http://example.com:8080/
        ProxyPassReverse / http://example.com:8080/
        ProxyErrorOverride Off
</VirtualHost>
link|improve this answer
feedback

This is done by http://the.site.invaild:8080/.

It is not possible to give a port in the DNS. The DNS only maps names to IPs. But no ports.

link|improve this answer
feedback

I think it is best to make your tomcat to listen to port 80.You can do this if there is no other server listen to the port 80.For that you can edit server.xml

Change as follows,

<Connector port="80" protocol="HTTP/1.1" 
           connectionTimeout="20000" 
           redirectPort="8443" />

Now you can try http://example.com/.This will correctly resolve to your tomcat instance.Because the default port of http is 80.

link|improve this answer
feedback

There might be a possibility in solving this via DNS: SRV-Records

With SRV-Records you basically tell DNS to answer a question like "where is the httpd from example.org"? And DNS answers with an IP-Adress AND a Portnumber.

Although I don't know if the clients requests this information or if the browser just does an A-Record lookup and requests the website from the given IP using port 80, this might be worth a try if you want to do it with DNS.

Otherwise: Let ether Tomcat listen to port 80 or redirect 8080 to Tomcat via Apache's mod_proxy.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.