Hello,
I am now able to forward an HTTP/1.1 request from Apache 2.2.14 to Tomcat 7.014 on Ubuntu 10.04 LTS (32-bit) in a VirtualBox 4.0.6r71416 on top of Windows 7 (64-bit):
The DocumentRoot for the default VirtualHost in apache2 is /var/www. In this folder, /var/www/Beer-v1/form.html is the only file (a static HTML page).
It is unnecessary to have WEB-INF/web.xml on the apache2 side.
$TOMCAT_HOME/webapps/Beer-v1/WEB-INF/web.xml is all that is needed to map SelectBeer.do to $TOMCAT_HOME/webapps/Beer-v1/WEB-INF/classes/com/example/web/BeerSelect.class
The following request is forwarded by the mod_jk.so to the tomcat-connector at port 8009 specified in $TOMCAT_HOME/conf/server.xml
I didn't modify $TOMCAT_HOME/conf/server.xml at all.
On the apache2 side, the workers.properties file specifies that worker.ajp13_worker.port=8009
mod_jk.so (1.2.28) is packaged with Apache2.2.14, and is in the /usr/lib/apache2/modules/mod_jk.so folder. I was able to successfully use this binary file without generating my own copy.
I was unable to auto-generate the mod_jk.conf file using the "-jkconf" option at Tomcat 7.0.14 startup. I don't think that it is possible with this version of Tomcat.
I did download tomcat-connectors-1.2.31-src.tar.gz from the tomcat-connectors website. This tarball has a file called httpd-jk.conf that is useful when generating your own mod_jk.conf
apache2 has another example /usr/share/doc/libapache2-mod-jk/httpd_example_apache2.conf
I used both of these examples to implement mod_jk.conf. I put the finished version in /etc/apache2/mods-enabled/mod_jk.conf. This file is Include in /etc/apache2/apache2.conf.
I removed "LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so" from mod_jk.conf. This line is already included in /etc/apache2/mods-enabled/jk.load.
I didn't "Include /usr/lib/apache2/modules/mod_jk.so" in httpd.conf.
I used the apache2 example in /etc/libapache2-mod-jk/workers.properties file. I copied, modified, and saved this file right in this folder.
In a fresh install of apache2, the /etc/apache2/httpd.conf file is empty. I put the following code snippet in this file. This file is Include in /etc/apache2/apache.conf.
There is an entry in /etc/hosts, i.e. 127.0.0.1 localhost.localdomain localhost
ajp13_worker was created in the workers.properties file.
I created a tomcat user in Ubuntu and in the $TOMCAT_HOME directory I executed the following command: sudo chown -R tomcat:tomcat *
This will only work after you create a tomcat user.
I also did this in $CATALINA_HOME.
A useful link is the following:
http://www.linuxjournal.com/article/8561
Regards,
Harry Henriques