Railo on MediaTemple DV Server

Wednesday, March 02, 2011

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:


Pre-Setup

  1. Setup and configure your Plesk admin panel
  2. Setup an initial user and site domain. In this guide we're using example.com
  3. In MediaTemple's Account Center, enable the root user, and install developer tools.
  4. Follow this guide to install the Yum package manager: http://wiki.mediatemple.net/w/DV:Install_YUM

Java Setup

  1. 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
  2. Install various packages using yum:
    yum install make nano httpd-devel openssl-devel
  3. 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.
  4. Next, download the Java JDK to a new software folder we'll create:
    cd /opt       
    mkdir soft
    cd soft
    The following wget command and the URL are all one line:
    wget 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.bin
    This will download the JDK. If the download looks like it is hanging you can press ctrl+c to break the wget command.
  5. 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.bin
    Follow along with the notes it produces and press 'enter' where necessary.

  6. 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

  7. 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/         
    export PATH=$JAVA_HOME/bin:$PATH
    Save the file and when complete, run this command to make it executable:
    chmod +x /etc/profile.d/java.sh

  8. 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

  1. 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.

  2. cd /opt/soft

  3. wget http://www.getrailo.org/down.cfm?item=/railo/remote/download/3.1.2.001/railix/all/railo-3.1.2.001-railo-express-without-jre.tar.gz

  4. tar -xvzf railo-3.1.2.001-railo-express-with-jre-linux.tar.gz

  5. Create a symlink just as we did with Java

    ln -s railo-3.1.2.001-railo-express-with-jre-linux railo

  6. cd railo

  7. Now to build and install it

    ./configure --with-java-home=/opt/soft/java/ --with-apxs=/usr/sbin/apxs         
    make
    make install
    Note: At the time of this writing the 'make' command will fail. If that occurs proceed with the following steps.
    mv 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

  8. 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

  9. Next we need to setup a location to check on the caucho status:

    cd /etc/httpd/conf.d         
    vim caucho.conf
    Enter the following lines:
    <Location /caucho-status>         
    SetHandler caucho-status
    </Location>
    Save and exit the file.

  10. 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">         
    <host-alias>www.example.com</host-alias>
    <web-app id="/" root-directory="httpdocs" />
    Save and exit the file.

  11. 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

  12. 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.

  13. Visit http://example.com/railo-context/admin.cfm and setup a password for that domain's railo context.

  14. 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.

Steve Jobs meet Steve Jobs

Tuesday, October 19, 2010

This clip is just amazing. I almost can't believe it exists. Steve Wozniak and Steve Jobs started out as phone phreakers, meaning they built devices to let them hack onto the phone network and make calls around the globe without paying.

That in and of itself isn't totally surprising. What is surprising is Jobs' admission that Apple probably would have never even started if he and Wozniak hadn't messed with phone phreaking.

 

It makes me wonder what Jobs really thinks of Jailbreakers.

Smooth Sega Sundown

Tuesday, August 10, 2010

I was a fan of Hyetal’s work before I knew his name thanks to Cexman’s brilliant Archbroseph Mix.  The song in that mix, Gold or Soul, is simple yet vast. This track is a level up.

Hyetal - Phoenix

Good Friday

Friday, March 12, 2010

The Secret Sun by Tanya Johnston

I don’t have much to offer right now other than three songs, loosely related.

I love Ffffound, and I love that despite my inescapable cynicism, thousands of people are somehow able to trudge through and make excellent stuff.

Here’s to a rainy weekend.

Yulquen - Autechre
Departures - Closer Musik
Absence - Clark

Quiet You

Friday, January 29, 2010

If you haven't seen this talk by Seth Godin on quieting the lizard brain, it's easily worth 18 minutes of your time:

Next Page