Apache Tomcat

Under UNIX all ports < 1024 are privileged ports. Only root may open a priviledged port. How to run Tomcat on port 80 without root privileges?

Put Apache httpd with mod_jk before your Tomcat servers, and use ports >= 1024 in the Tomcat(s).

/etc/httpd/conf/httpd.conf

ProxyRequests Off

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

ProxyPass         /myapp  http://localhost:8082/myapp
ProxyPassReverse  /myapp  http://localhost:8082/myapp

Use name-based virtual hosting

NameVirtualHost *:80

# NOTE: NameVirtualHost cannot be used without a port specifier 
# (e.g. :80) if mod_ssl is being used, due to the nature of the SSL protocol.

# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known server name.

<VirtualHost *:80>
   ProxyPass         /  http://localhost:8080/
   ProxyPassReverse  /  http://localhost:8080/
   ServerAdmin webmaster@bangtechtest.com
   DocumentRoot /var/www/bangtechtest.com
   ServerName 97.74.215.96
   ServerAlias bangtechtest.com
   ErrorLog logs/bangtechtest.com-error_log
   CustomLog logs/bangtechtest.com-access_log common
</VirtualHost>

<VirtualHost *:80>
   ProxyPass         /  http://localhost:9080/
   ProxyPassReverse  /  http://localhost:9080/
   ServerAdmin webmaster@lastmorsel.com
   DocumentRoot /var/www/lastmorsel.com
   ServerName 97.74.215.97
   ServerAlias lnpstest.contentdsi.com
   ErrorLog logs/lastmorsel.com-error_log
   CustomLog logs/lastmorsel.com-access_log common
</VirtualHost>

../conf/server.xml

<Connector port="8082" ...
    proxyName="www.mycompany.com"
    proxyPort="80"/>

Tomcat Proxy Support

To use iptables to redirect Port 80 and 443 to user ports >= 1024