Tomcat deployment

Now that we have all of the necessary components, we can begin our integration of Tomcat and the Apache Web server.

The first step is to copy the mod_webapp.so file, found in the Web Application Module archive, into the Apache /libexec if installing to Linux, or the Apache /modules directory if you are performing a Windows installation.

If you are using Apache 1.3 for Windows, copy the libapr.dll file (which is also found in the Web Application Module archive) to the <APACHE_HOME>/modules/ directory.

If you do not perform this step, the Apache server will not start, reporting that the Web application module cannot be loaded. Once you have copied the appropriate files to the appropriate locations, edit the Apache httpd.conf file, found in the <APACHE_HOME>/conf/ directory, by adding the following lines for a Linux installation:

LoadModule webapp_module libexec/mod_webapp.so
AddModule mod_webapp.c

or the following lines if you are installing to Windows:

LoadModule webapp_module modules/mod_webapp.so
AddModule mod_webapp.c

Now it's time to add the proper entries to publish your Web application connections and context paths to Apache.

To do this, for the /test Web application, add the following lines to the end of the <APACHE_HOME>/conf/httpd.conf file:

WebAppConnection conn warp localhost:8008
WebAppDeploy test conn /test

The first line of this entry adds a Warp connection to a Tomcat server running on the localhost and listening to port 8008, for all incoming requests.

The format of this entry is: WebAppConnection connectionname provider host:port

The second line of this entry defines a Web application that is associated with the previously defined connection.

In this entry, we are defining the Web application named test that is associated with the connection conn and has a context path of /test.

The format of this entry is as follows: WebAppDeploy applicationname connectionname path

Other possible connectors include mod_jk and mod_proxy. Our VPS hosting uses mod_proxy and comes pre-configured. In our experience, it's the fastest apache connector

Contact sales!