The main reason why ColdFusion isn’t used more is that the licenses for the software to run on a server can be quite expensive (at the moment Adobe, the current ColdFusion owners, are selling full first time licenses for around £815). And even getting a shared hosting package can prove significantly more costly than the non-ColdFusion alternative.
But, it isn’t all doom and gloom! To use the fantastic CFML language you do not need to part with a huge wad of cash! An alternative exists!
This alternative is Railo – a free open source interpreter and application server that processes CFML (and associated) files.
The two main differences between Railo and ColdFusion are that Railo doesn’t support every tag that ColdFusion does and that Railo is quite challenging to install and configure compared with ColdFusion.
Now, firstly, the issue with Railo not supporting all the tags that ColdFusion does. Most of the tags that are not supported by Railo are rarely used by developers. In fact, most developers who develop a ColdFusion websites are unlikely to notice the difference between using Railo and ColdFusion.
Unfortunately, with the second issue, it is what it is. Installing Railo isn’t for the faint hearted. A good knowledge of web hosting, servers, operating systems (Linux or Windows – depending on which is installed on your server) and SSH would be quite advisable. The thing that also compounds this issue is that there isn’t a lot of clear information on the Internet regarding the installation and configuration of Railo. This second issue will cause many people to give up after a while of trying to get Railo working.
In light of this, and the lack of material relating to Railo installation and configuration, we’ve compiled a list of tips which should hopefully help you through some of the major (and time consuming issues) that you may face if you are trying to install Railo on your server.
Firstly – as you are installing the different pieces of software required on your server, don’t forget to check after each installation that the relevant processes have actually started to run on your server (you can do this via SSH or WHM). Ultimately you want to have processes running for Railo, Tomcat and Resin running on your server.
Please take note – the Railo process is named “Railo / Tomcat” – don’t be fooled into thinking that this is confirming that Tomcat is actually running. It may well be coincidently running, but not necessarily. The “Railo / Tomcat” process that is reported as running, is actually just confirming that Railo is running. Tomcat should have its own separate process. To double check if Tomcat is also running, check which ports are open and listening (via SSH) and what service is running on them. During the Tomcat installation you should have selected a port for it to run on – check the port is open and listening and you can also check via your web browser that you can access it (http://:).
Secondly, Operating System updates. Make sure you have done them! Railo / Tomcat / Resin can have issues running on older versions of some operating systems. For example, Linux users who are using CentOS 4.x will encounter difficulties. Ensure that if your server is running CentOS that you are on at least version 5.x (we would recommend that you are running the latest version of CentOS which, at the time of writing, is 6.2).
Thirdly – ensure you can access the Tomcat admin panel. You can do this by going to http://:/admin. Log in using the username and password that you specified during the installation of Tomcat.
Next, ensure that Railo is accessible – go to the Railo admin panel (which will be running on the port that you specified during the installation of Railo). When you first visit it, you will be asked to select a password for both the server and web administrators. Set these as soon as possible to sure your Railo admin panel. While here, ensure all the settings are correct – these will be different from server to server.
Next, quite a common but very frustrating problem. Are you seeing the dreaded CFML style 404 page not found error page? Obviously, I’ll assume that you have checked via cPanel File Manager (or similar) that your test CFML file is there. If it is, this would indicate that you haven’t set the home directory for Resin / Railo correctly (or at all!). Make sure that the home directory is pointing to the public_html / www folder of the domain that the file is on. The home directory can be specified in the Railo config files (inside the railo folder in /opt).
Next, was everything working one second and now its not? Getting a 503 service error? You (or your host) has most likely rebooted your web server and either Resin/Railo/Tomcat has not been correctly configured to boot at startup. You can confirm via SSH by looking at the processes to check whether they are all up and running or not. If not, you’ll need to start them manually and then make the necessary changes to the relevant config files to get them to boot with the server.
Next, please note that after starting or restarting Resin it takes a few minutes to get up to speed! During that time you may still see 503 service errors – don’t worry, everything is probably fine. Give it a few minutes to start up and you should see your CFML pages being processed as usual. If after a few minutes you are still seeing 503 service errors, then you need to consider other possibilities.
And finally, probably the single most important, frustrating and time consuming problem experienced by people trying to install Railo:
A lot of people, if they are going to install Railo, will try to do this on a test server / account at first. And a lot of people will not have a domain (or have a fake domain) specified in their control panel with their account. Usually this isn’t a problem, but with Railo, it can be! Unbeknown to us, Railo uses the domain name of accounts during setup and silently inserts it into the config files and uses it as the base address for where files are stored – but if the domain doesn’t exist, it’ll fall back to the default directory to find the specified file – and this is a web apps directory in the resin folder (which is definitely not where it is going to find your uploaded files which are obviously in the public_html directory) of your test account. One solution to the problem is to use a real domain (that you own!) and rebuild the Railo config. Hey presto, things should start working. If you don’t want to do this you can edit the config file (resin.conf) in the resin directory and search for your fake “domain name”. Then replace this with your servers IP and account name in the format/~. For this to work, ensure that you have the apache usrdir protection disabled.
If you’ve got any more tips for Railo installation and configuration then please feel free to share them in the comments below or on the forums. Please also share if you have your own experiences of Railo installation and configuration and how it was for you.
Hopefully this will help many of you out, who, by the time you find this article, are likely to already be pulling your hair out!!