I recently installed Railo 4.0.2 on a Debian server and it was an absolutely smooth ride.
I essentially followed the installation guide provided in the Railo wiki. It’s really straight forward, but let’s go through the steps.
Start here: Installation:InstallerDocumentation:LinLaunching
Most likely (on a web server environment) you won’t have a UI available to you. You can grab the installer with a simple wget from the shell as shown on the wiki page. I used the 4.0.2 installer for 64-bit Linux with integrated Tomcat as provided here: *nix 64bit run (129 MB) and I didn’t install it with any UI.
Once you have the installer, make sure it’s executable and run it as root or through sudo (Note: I installed it as root and changed the user/group later).
Next step: Run the installer. You will be asked a bunch of questions:
Installation Directory [/opt/railo]: Tomcat Administrator Username [admin]: Tomcat Administrator Password : ********************* Tomcat Port : ******************** Tomcat System User [root]: ... Install Apache Connector? [Y/n]: ... Apache Control Script Location [/etc/init.d/apache2]: Apache Modules Directory [/usr/lib/apache2/modules]: Apache Configuration File [/etc/apache2/apache2.conf]: Apache Logs Directory [/var/log/apache2]:
On a standard Debian installation you should be able to go with the defaults for most of the settings. I strongly recommend using the installer to setup the Apache Connector for you – it will save you a bunch of configuration further down the track. Behind the scenes it’s using the ModCFML project and proxying for the hookup between Apache and Railo.
One additional note: the Tomcat Administrator Password that you specify during the installer process will also be the default password for your Railo Server and Web administrator environments. I’m not sure if that’s documented somewhere, but I thought it’d be worth mentioning.
Above you can see that I installed Railo and Tomcat as root. It did that for convenience during the installation but you don’t want to run Railo as root later on. The first thing after installation should be to change the user the server is running as as described in Installation:InstallerDocumentation:LinRunAsUser. Please make sure you use the instruction as provided in exactly that document as there was a documentation issue (a required parameter missing) that I’ve just fixed on that Wiki page. They way how I’ve set it up for that particular server was essentially to run Railo under the same user as Apache and provide access to site’s and actual user’s home directories via folder/file rights through a shared group. There are plenty of other ways how you could organise your web server access management though.
After that’s done your Railo server should work. It should also have setup the Apache connector configuration for you. The last bit is to tie your existing (or new) virtual hosts into the Tomcat configuration. You can find that described in Installation:InstallerDocumentation:LinAddingSites. If you chose to install the Apache connector as I did, the top part of that document is not relevant for you. Start reading from “Tomcat Configuration” onwards and add your site(s) in Tomcat’s server.xml. Restart Railo and off you go.
Well. Yes. I thought. When I was trying to access some of the sites I got a server error 500. Why’s that? Turns out that Railo would write a /WEB-INF directory into your site’s root folder. In my case the group the Railo user was part of didn’t have write access to the site folder. A simple chmod fixed that. Now again: “Restart Railo and off you go.”. This time for real!