Multiple Railo Servers on one Tomcat install

Dec 7 2013

Multiple Railo Servers on one Tomcat install

Posted by AJ Mercer at 4:59 PM
2 comments
- Categories: Railo | Tomcat

I have been wanting to run multiple Railo servers on one machine (distinct from multiple web sites on one server). For example, a dev, test, and production Railo servers, or Public and Internal Railo servers. Earch Railo server would run on it's own port.

After messing around with WildFly, Glassfish and Geronimo, I discovered that Tomcat itslef can run multiple instances. Then I found this gem: Tomcat Instance Manager - bat files for windows that copy required directories and creats a bat file with environment variables.

I have now created a standard Railo directory structure that I can copy that has the Railo web.xml and server.xml files. So you copy and rename this directory, edit some files and an new environment is ready, well almost. You will need to get the Railo JARs and drop them into the lib folder. I download the Railo WAR and extract the lib and 'Welcome to Railo' app (this also has web.xml and server.xml). You can do this first and put into the template directory so it is set up for all copies. I kept it out to keep the download small. Also, for may want to drop the next Bleeding-Edge version into a new instance.

 

To start off, you need to get yourself Tomcat and save to your server. No need to run the service install, you just need the bin and lib folders.

Then you need a directory to hold all the server instance directories; I call mine servers. This is where you drop the Railo Directory Template (github URL here). There is also a directory for Tomcat Instance Manager.

The magic happens with environment variables. CATALINA_HOME points to the tomcat directory, eg d:\tomcat7. CATALINA_BASE points to the Tomcat instance directory, eg %CATALINA_HOME%\servers\railo8808. This is set up in the bat files. The Tomcat Instance Manager creats a bat file for each instance. This bat file accepts arguments to start and stop, and also create a windows service, and arguments to stop and start this.

Comments

Ming

Ming wrote on 12/08/13 1:15 PM

Railo expert, you are so good!

multiple production websites I used apache filter cfm file, then through to Railo.

You are Railo God!

Write your comment



(it will not be displayed)