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).


ProxyRequests Off

<Proxy *>
    Order deny,allow
    Allow from all

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
   ServerAlias bangtechtest.com
   ErrorLog logs/bangtechtest.com-error_log
   CustomLog logs/bangtechtest.com-access_log common

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


<Connector port="8082" ...

Tomcat Proxy Support

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