Make Tomcat Work Through Port 80

Document Information
Document ID: 
app2009-004

On a machine running Tomcat and Apache, you can set things up so that instead of having to type Tomcat URLs with ":8080" on the end of the domain, you use a proxy to redirect that traffic to Tomcat.

I had to adjust two files: httpd.conf in my \conf directory, and server.xml in my \conf directory. My edited files are attached.

For the Apache configuration (httpd.conf), you have to do three things:

1. Uncomment three lines by deleting the "#" at the beginning of the line:

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

2. Add the following lines directly below all the "LoadModule" commands:

TraceEnable off
ProxyRequests Off
ProxyPreserveHost On
<ProxyMatch http://[^/]*/*>
Order deny,allow
Allow from 127.0.0.1
</ProxyMatch>

3. For each webapp that you want redirected, add the following lines (example below is for my geoserver webapp, and "malachite" is the domain name for my server):

ProxyPass /geoserver http://malachite:8080/geoserver
ProxyPassReverse /geoserver http://malachite:8080/geoserver
<Location /geoserver>
Order allow,deny
Allow from all
</Location>

For the Tomcat configuration (server.xml), find the "Service" element, and the "Connector" child element. To that "Connector" element, add the attributes proxyName="<your domain name (malachite in my case)>" and proxyPort="80".

NOTE: I had to change the extension on the httpd.conf file in order to upload it here. On your computer the file has to be named "httpd.conf" and not "httpd.txt"

Resources
Application Documents Description Document ID Posted by Updatesort icon Rating
How to Install Apache Tomcat for Development Mode The following text was taken from the RUNNING.txt file found in the root folder of a downloaded and unzipped copy of... app2011-025 averill.cate 02/25/2011 - 2:55pm
0
Make Tomcat 6.x work in IIS7 This is a walkthrough to help you use ISAPI Filters to run Tomcat on a Windows Server Machine that uses IIS7. If you're... app2010-015 Ryan Clark 04/14/2010 - 3:21pm
5
Running GeoNetwork 2.4.1 under Tomcat 5.5 on Windows XP This cookbook describes how GeoNetwork 2.4.1 can be made to work under Tomcat 5.5 (JDK 1.5.0_17) on Windows XP. This... app2009-007 wgrunberg 10/09/2009 - 3:05pm
4.5