I am just taking a few notes (mainly from the mailing list) for my next HowTo.
Notes from the mailing list for the future release :
This is on a RH 7.2 machine, BTW.
1) install Tomcat 4. Verify Tomcat 4 (served content on port 8080, examples work).
2) install Apache 2 with DSO support, SSL and apxs. Verify Apache 2 (served content on port 80).
3) download the mod_webapp source, extract it. Read README.txt in the webapp directory after extracting the source.
3) download the Apache Portable Runtime (APR) source from CVS as stated in mod_webapp README.txt, build and install (note: I did not install ant as mentioned in the README.txt file). "./configure --enable-so --enable-ssl --with-apxs"
4) build mod_webapp from source according to README.txt after APR is installed. Make sure the build/configure process is pointed to the right apxs (apache 1.3 or apache 2.0). configure does an "autosense" of which version of Apache you have based on which apxs it can find. "./configure --with-apxs=/your/path/to/apache2/bin/apxs --with-tomcat=/your/path/to/jakarta-tomcat-4.0.3"
5) install mod_webapp according to INSTALL.txt
6) put the following into httpd.conf, verify with "$APACHE_HOME/bin/apachectl configtest": LoadModule webapp_module /usr/lib/apache/mod_webapp.so <IfModule mod_webapp.c> WebAppConnection warpConnection warp XXX.XXX.com:8008 WebAppInfo /webapp-info WebAppDeploy examples warpConnection /examples WebAppDeploy webdav warpConnection /webdav WebAppDeploy tomcat-docs warpConnection /tomcat-docs </IfModule>
7) in $CATALINA_HOME/conf/server.xml, on or about line 291 of 333, change the name parameter of the "Engine" directive to be the same as the ServerName directive in $APACHE_HOME/conf/httpd.conf.
8) Stop apache.
9) Stop tomcat...wait at least 10 seconds. Verify down with "ps -ef |grep java"
10) Start tomcat...wait at least 10 seconds. 11) Start apache.
12) Verify that tomcat examples work on port 80 (http://host.domain.com/examples/) Note that you need the trailing slash! Doing this got me the Tomcat servlets running from host.domain.com/examples (not host.domain.com:8080/examples which is Tomcat stand-alone), so I'm pretty sure everything is set.
The Tomcat I used was the Standard version from: http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.3/bin/ The Apache I used was the standard apache 2.0.36 from one of the mirror sites. The mod_webapp connector I used was retrieved from: http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.3/src/ John Turner
Apache 2 doesn't have two different module directives. Apache 1.x had directives to load the module into runtime (LoadModule) and to enable it (AddModule). So, all modules, both static and dynamc, had to be "Add"-ed, but only dynamical module had to be "Load"-ed first. With Apache 2.0 all statically linked modules are already there and dynamical only have to be loaded.
I got two major problems. 1) with apache 1.3.x is the trailing '/' for a directory. 2) with apache 2.0.36 tells me the index.html not found under the tomcat directory. Both problems are not acceptable for a released product. I cannot ask my users to add a trailing '/' for a directory url because it just is not a normal behavior for apache.
I just did this:
RewriteEngine on RewriteBase / RewriteRule ^webApp$ webApp/ [R]
based on this URL: http://httpd.apache.org/docs/misc/rewriteguide.html in Apache 1.3 with TomCat 4.0.1 using mod_webapp. Seems to work fine...
...