Wednesday, December 1, 2010

Apache Server with Tomcat server

The simplest configuration is described. It assumes you already have Tomcat 5.5 and Apache 2.0 (instructions for Apache 1.3 is also provided) installed and running.

The instructions are applicable (have been tested) for Windows as well as Linux platform.

Assume you want to map test directory of Apache to the mytest web application of Tomcat. Change the name appropriately to suit your configuration.

1. Shutdown Apache & Tomcat Server
2. Add the following lines to httpd.conf (in conf directory of Apache base directory)

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
ProxyPass /test/ http://localhost:8081/mytest/
ProxyPassReverse /test/ http://localhost:8081/mytest/

Note 1: Replace localhost with the appropriate IP address or hostname of the server where Tomcat is installed.

Note 2: On older Apache 1.3 you will have to use libproxy.so instead:
LoadModule proxy_module modules/libproxy.so
AddModule mod_proxy.c

No comments:

Post a Comment