Railo on Tomcat revisited - mod_proxy
To that end I investigated the use of mod_proxy for linking it to apache instead of mod_jk.
Advantages of this approach are:
- Simple - communications are in plain http
- Flexible - Load balancing can be easily added at the apache layer
- Simple - No compiling mod_jk
Here are the basic install instructions for Railo/Tomcat/Apache on Ubuntu.
Download & Install Tomcat
Download tomcat and extract content:
Move Tomcat to a more appropriate place:
Download Railo
Download Railo custom version jars file
Extract and move into Tomcat lib directory:
sudo mv railo-3.1.2.001-jars/* /opt/tomcat/lib
Make Tomcat and Railo work together by modifying the web config file:
add the following inside the <web-app> element:
<servlet-name>CFMLServlet</servlet-name>
<servlet-class>railo.loader.servlet.CFMLServlet</servlet-class>
<init-param>
<param-name>configuration</param-name>
<param-value>{web-root-directory}/WEB-INF/railo/</param-value>
<description>Configuraton directory</description>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CFMLServlet</servlet-name>
<url-pattern>*.cfm</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>CFMLServlet</servlet-name>
<url-pattern>*.cfml</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>CFMLServlet</servlet-name>
<url-pattern>*.cfc</url-pattern>
</servlet-mapping>
add the following inside <welcome-file-list> element:
<welcome-file>index.cfml</welcome-file>
Start up tomcat:
Back to Tomcat
To test our Railo installation, let's create a test site by adding a new virtual host in both Tomcat and Apache. We do this by modifying Tomcat server.xml file (/opt/tomcat/conf/server.xml )<Context path="" docBase="/vhosts/testsite.railo/www"/>
</Host>
Linking with Apache via Mod Proxy
Ensure the modules proxy and proxy_http are enabled. On Ubuntu this is done as follows:
sudo a2enmod proxy_http
sudo /etc/init.d/apache2 restart
Create vhost
Now we need to create a virtual host entry in Apache as well:DocumentRoot /vhosts/testsite.railo/www
ServerName testsite.railo
DirectoryIndex index.cfm
#Proxy .cfm requests to railo
<IfModule mod_proxy.c>
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPassMatch ^/(.*\.cfm)$ http://testsite.railo:8080/$1
ProxyPassReverse / http://testsite.railo:8080/
</IfModule>
#Deny access to admin except for local/portforwarded clients
<Location /railo-context/>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
</VirtualHost>
This tells apache to forward all requests for CFM files to the railo instance.
Finally restart apache and railo and you should be good to go.
sudo /opt/tomcat/bin/startup.sh
sudo /etc/init.d/apache2 restart



Our service: