The objective of this excercise is to get Apache and Tomcat connected, we want Apache the default web server that serves the port 80 to forward requests to Tomcat - Railo.
The end goal for me in this case, is to get Apache / Tomcat / Railo to serve up http://personal.ecommerce2
Note, this post is really based on very excellent series on installing multiple ColdFusion servers by Dave Shuck: Installing-Railo-under-Tomcat-with-Apache-webserver
Step 1 - Download the Apache - Tomcat connector
Get the connector from http://tomcat.apache.org/connectors-doc/
I’m getting the Windows one since uhm.. I’m setting up my windows environment. Just click on binaries link on that page and find the one for Windows (32 bit in my case) - the latest one available is: mod_jk-1.2.28-httpd-2.2.3.so and so I grabbed that one.
I put the .so file into the :
C:\Program Files\Apache Software Foundation\Apache2.2\modules which my Apache installation folder.
Step 2 - Configure the connector
I then need to tell Apache to load this module when it starts up - so I added this section on my Apache’s httpd.conf file - at the bottom of the file:
1 2 3 4 5 6 7 8 | |
And then I created workers.properties file and put it on
C:\Program Files\Apache Software Foundation\Apache2.2\ folder
The content of that file is like this (straight copy from Dave’s post):
1 2 3 4 5 6 | |
Step 3 - Adding the site to Hosts, Apache and Tomcat
Next as usual, I added personal.ecommerce2 to my hosts file.
I then added the site definition to my Apache vhost file, which in my case located on:
C:\Program Files\Apache Software Foundation\Apache2.2\conf\extra\httpd-vhosts.conf
This is the section that I added:
1 2 3 4 5 | |
Next, I need to add the site definition to the Tomcat’s server.xml - which in my case located on C:\opt\railo\tomcat\conf\server.xml
I added this bit at the end of the file (between the closing Host tag and closing Engine tag):
1 2 3 4 | |
Now, I restart Apache and restart Tomcat and go to the URL and it’s there!!
This particular site is using ColdBox with URL rewriting on and I couldn’t go far navigating the pages because Tomcat doesn’t support URL rewriting out of the box.
So for the next challenge for me is to figure out how to get URL rewriting to work on Tomcat - which apparently again not a hard thing to do.. but we’ll see..