Railo on MediaTemple DV Server
A few months back I was tasked with getting Railo to run on MediaTemple’s DV server. It was a success, but a bit hairy at points. I had to cobble together instructions from several other guides and wing it in places that they didn’t cover.
What follows is instructions to get Railo, and thus ColdFusion support, running on a server stack that doesn't support it out of the box.
A few notes:
To the best of my knowledge and testing, installing Railo will not interfere with the default Apache, MySQL, or PHP's ability to serve pages. Also I am posting these instructions in the event you want or have to put Railo on a DV server. If you’re just looking for solid Railo hosting, I suggest VivioTech.
Also, This guide assumes you have at least basic knowledge of VI or its sibling VIM. If not, head over here to get yourself acquainted.
Getting Started
Tutorials used in the creation of this guide:
- http://po.chassay.net/blog/post.cfm/installing-railo-3-1-0-012-on-linux-cent-os-5-2
- http://www.harrassed.net/2010/04/railo-installation-and-setup-centos-cpanel-and-resin/
- http://www.escapekeys.com/blog/2010/2/15/Installing-Railo-312-on-Centos-54
- http://hostek.com/faq/kb/?action=recorddetail&rec=335&category=VPS
- http://blog.getrailo.com/post.cfm/installing-resin-railo-on-centos
Pre-Setup
- Setup and configure your Plesk admin panel
- Setup an initial user and site domain. In this guide we're using example.com
- In MediaTemple's Account Center, enable the root user, and install developer tools.
- Follow this guide to install the Yum package manager: http://wiki.mediatemple.net/w/DV:Install_YUM
Java Setup
- SSH into your dv server through the terminal, where '1.2.3.4' is your DV server IP.
ssh 1.2.3.4 -l root - Install various packages using yum:
yum install make nano httpd-devel openssl-devel
- Search for and copy the download URL to the latest Java JDK (not JRE) for Linux. I'm not sure if MT's DV servers are 64 bit but I downloaded the non 64-bit version. Look for the non rpm.bin file.
- Next, download the Java JDK to a new software folder we'll create:
cd /opt
The following wget command and the URL are all one line:
mkdir soft
cd softwget http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u23-linux-i586.bin?BundledLineItemUUID=5jqJ_hCvx5YAAAEsdwgpG9Ey&OrderID=c4OJ_hCvOFIAAAEsaQgpG9Ey&ProductID=QhOJ_hCw.dUAAAEsFIMcKluK&FileName=/jdk-6u23-linux-i586.binThis will download the JDK. If the download looks like it is hanging you can press ctrl+c to break the wget command. -
Now to install the JDK. The wget command may have downloaded the file with a large filename. Utilize tab completion for the following steps. In this instance, I would literally type
./j{tab}and bash should autocomplete the rest of the path./jdk-6u23-linux-i586.bin?AuthParam=1292000585_91de5ecde936ffb92e8f395cbe369400&TicketId=nod2B1wRR3N7lesslEaeVZeZcg==&GroupName=CDS&FilePath=%2FESD6%2FJSCDL%2Fjdk%2F6u23-b05%2Fjdk-6u23-linux-i586.bin&File=jdk-6u23-linux-i586.binFollow along with the notes it produces and press 'enter' where necessary. -
Now we have a folder named jdk1.6.0_23. Let's create a symlink so that we can upgrade java later if necessary.
ln -s jdk1.6.0_23 java
Our Java directory is now/opt/soft/java
-
Let's add java to our path
nano /etc/profile.d/java.sh
Add the following lines to java.sh:export JAVA_HOME=/opt/soft/jdk1.6.0_13/
Save the file and when complete, run this command to make it executable:
export PATH=$JAVA_HOME/bin:$PATHchmod +x /etc/profile.d/java.sh
-
Log off your SSH connection and re-login. Try:
java -version
If Java is installed correctly you should see:java version "1.6.0_23"
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
Java HotSpot(TM) Client VM (build 19.0-b09, mixed mode)
Railo Setup
-
Find the latest Railo stable release download URL. You want the 'with-jre' option. Technically we don't need its included JRE, but when this guide was written it was the only available download with configure and make files.
-
cd /opt/soft
-
tar -xvzf railo-3.1.2.001-railo-express-with-jre-linux.tar.gz
-
Create a symlink just as we did with Java
ln -s railo-3.1.2.001-railo-express-with-jre-linux railo
-
cd railo
-
Now to build and install it
./configure --with-java-home=/opt/soft/java/ --with-apxs=/usr/sbin/apxs
Note: At the time of this writing the 'make' command will fail. If that occurs proceed with the following steps.
make
make installmv Makefile.in Makefile.in.tmp
mv Makefile.am Makefile.in
make reset
./configure --with-java-home=/opt/soft/java/ --with-apxs=/usr/sbin/apxs
make
make install -
If everything went well, the following lines should be added to the end of your httpd.conf file at /etc/httpd/conf/httpd.conf
LoadModule caucho_module /usr/lib/httpd/modules/mod_caucho.so
ResinConfigServer localhost 6800
CauchoConfigCacheDirectory /tmp
CauchoStatus yes -
Next we need to setup a location to check on the caucho status:
cd /etc/httpd/conf.d
Enter the following lines:
vim caucho.conf<Location /caucho-status>
Save and exit the file.
SetHandler caucho-status
</Location> -
Finally we add our domain name to the resin.conf file:
cd /opt/soft/railo/conf
vim resin.conf
Find a spot between </host-deploy> and the next comment or opening tag such as <host id="" … and enter the following:<host id="example.com" root-directory="/var/www/vhosts/example.com">
Save and exit the file.
<host-alias>www.example.com</host-alias>
<web-app id="/" root-directory="httpdocs" /> -
Let's setup resin to startup on boot. We need to copy the startup script (that was created for us when we built resin) to the /etc/init.d folder. We change its permissions and then set it up to run on boot.
cp /opt/soft/railo/contrib/init.resin /etc/init.d/resin
cd /etc/init.d
chmod +x resin
chkconfig --add resin
chkconfig resin on -
Reboot your DV server from plesk. When it comes back online you should be able to view files on your domain, in this case id5.us.
-
Visit http://example.com/railo-context/admin.cfm and setup a password for that domain's railo context.
-
Visit http://example.com/railo-context/admin/server.cfm and setup a password for the server-wide railo context.
That's about it. You should now be able to upload and install Mura or any other CFML based software and run it on your MediaTemple DV hosting.

