Install Railo on Slicehost Centos 5.2 Part 3
Linux , CentOS , Railo , Apache , Java , Coldfusion Add commentsOK, we now have a web server running and a database running. Wouldn't it be great if we could output the data on the web? That's what I thought, so let's get Railo installed and start publishing some CFML. This section of the series is when we get to compile our own connector between Apache and Resin. It is also the piece that was difficult to track down what went wrong. The actual compiling and installing isn't difficult, it is more the knowledge of the arguments needed to make it work on this set up.
First things first, we need the Java Development Kit. It is important that we get the actual JDK and not the JRE (Java Runtime Environment). At the time of this writing the current version is JDK 6 Update 13 and that is what we'll use here. Again borrowing (heavily) from Mark McAulay's Post on the subject let's download and install JDK 6.
Create a directory to store the download and switch to that directory.mkdir sources<br />cd sources
Now let's go get the download. In your browser on your local machine go to Sun's Java Download Page. Choose to download the most recent JDK. On the next page choose linux for you platform and agree to their terms. On this page you will have two choices. We want the JDK that does NOT have rpm in the file name. Right click on the link and "Copy Link Location". It should look like the following of you paste it somewhere.http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u13-linux-i586.bin?BundledLineItemUUID=CGhIBe.p8gwAAAEgj3oRO2CT&amp;OrderID=j0BIBe.pi8IAAAEggXoRO2CT&amp;ProductID=RGtIBe.ou1AAAAEfpVYcydOO&amp;FileName=/jdk-6u13-linux-i586.bin
With the link in hand, lets get it on the server.curl -L -O 'http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u13-linux-i586.bin?BundledLineItemUUID=CGhIBe.p8gwAAAEgj3oRO2CT&amp;OrderID=j0BIBe.pi8IAAAEggXoRO2CT&amp;ProductID=RGtIBe.ou1AAAAEfpVYcydOO&amp;FileName=/jdk-6u13-linux-i586.bin'
Now we need to create a directory to install it into.cd /opt<br />mkdir soft<br />cd soft
Note: That is also the directory that Resin/Railo will be installed.
Now we need to move the .bin file and install it and for ease of use create a symbolic link.mv /sources/jdk-6u13-linux-i586.bin /opt/soft/<br />cd /opt/soft<br />sh jdk-6u13-linux-i586.bin<br />ln -s jdk1.6.0_13 java
Accept that novel of a license by holding the enter key down. Now we need to add Java to our path.nano /etc/profile.d/java.sh
Now type the following into the file.export JAVA_HOME=/opt/soft/jdk1.6.0_10/
<br />export PATH=$JAVA_HOME/bin:$PATH
Ctrl+X and 'y' to save the file. Mark makes mention of using Alternatives which seems like a good idea, but beyond what I am trying to accomplish, read his post linked above more information on that. Not sure why, but at this point I actually had to log off by typing 'exit' and then SSH back in. Once you have done that type:java -version
That should return the version of Java we just installed. We are half way there. Let's make sure we have all the necessary tools to compile.yum install httpd-devel openssl-devel lynx
Now we need to get Railo and install it. (Railo just release V3.1 Beta with JBoss and we will get to that at the end of the series for now we will be using 3.0.2). Go to the OLD Railo Site and find the current version of Railo Server (not Express) for ALL OS. There will be two, a zipped version and a tarball version, you want the tarball (.tar.gz). At the time of this writing this is the link used (http://www.railo-technologies.com/down.cfm?item=/railo/remote/download/3.0.2.001/server/all/railo-3.0.2.001-resin-3.1.2-without-jre.tar.gz).
Switch to your "sources" download folder and download that link.cd /sources<br />wget
http://www.railo-technologies.com/down.cfm?item=/railo/remote/download/3.0.2.001/server/all/railo-3.0.2.001-resin-3.1.2-without-jre.tar.gz
OK, now we need to go to our install directory and "unzip" the download and create a symbolic link for railo.tar xzf /sources/railo-3.0.2.001-resin-3.1.2-without-jre.tar.gz<br />ln -s railo-3.0.2.001-resin-3.1.2-without-jre railo
Now for the fun part. This is where I had to do some research and it is VERY important you read the output, scanning for errors. We are going to compile this bad boy. I had originally followed Gert Franz post (which is a very good reference for this process) but it was missing something critical. You see the 32bit portion of the compiler is not here and that is what was expected. So you MUST use the "—enable-64bit" argument.cd railo<br />./configure --enable-64bit --with-java-home=/opt/soft/java --with-apxs=/usr/sbin/apxs<br />make<br />make install
Like I said above look for errors, scroll back up in the terminal if necessary. While I didn't need it they have been reports of needing the "—enable-jni" argument as well as needing "—with-apxs2" instead of "—with-apxs". If you have no erros, fantastic and pat your self on the back you have compiled the connector. See not that hard.
We will want to verify that the mod_caucho module was correctly installed and configured in the Apache Web Server. To do this we must check the httpd.conf file.nano /etc/httpd/conf/httpd.conf
At the bottom of this file (CRTL+V to page down quickly) should show you the following.LoadModule caucho_module /usr/lib/httpd/modules/mod_caucho.so<br />ResinConfigServer localhost 6800<br />CauchoConfigCacheDirectory /tmp<br />CauchoStatus yes
If it is all there it is time to fire up the server, set it to start on boot and restart Apache./opt/soft/railo/bin/httpd.sh start<br />chkconfig --add resin<br />chkconfig resin on<br />/etc/init.d/httpd restart
Hopefully things are going well for you so far. With no errors, you should be able to get into the Railo administrator. You will find it located at http://ipaddress/railo-context/admin.cfm. Set your new password for the admin and have fun. In the next post we will cover setting up VSFTP to enable you to FTP files to your server.
Apr 2, 2009 at 6:15 AM Which software you will consider as your mailserver for your VPS and why? Myself too interested to try out Railo and booking a VPS:)
Apr 2, 2009 at 6:35 AM OK... we package stuff up in frameworks. We package stuff up in zip files. We build installers. We deliver code as executables. So... what is my point or question? When is someone going to start packaging Railo as a virtual server package for people to install on both 32 and 64 bit systems. I see it coming but others might be able to get it out long before me... any givers?
Apr 2, 2009 at 1:39 PM @Shimju
I haven't decided on a mail server yet. I am currently leaning to PostFix, but am still researching my options and when I decide I will be adding its information to this series of posts.
@John,
One of my current goals is to replicate this setup in Parallels (and possibly VMWare) and distribute that package, while not a VPS solution for hosting, I think it will help people set it up for their local development environments. Maybe I will dig into actual VPS solutions for hosting providers and see if we can't get something going.
Apr 3, 2009 at 1:38 AM @Mike,
Kindly go through http://shimju.wordpress.com/2009/04/02/the-most-needed-tutorial-of-railo-now-is/
We feel you are the perfect guy to help us.
Thanks
Apr 3, 2009 at 3:47 PM @John,
I have been speaking with Slicehost.com about your idea and they think is has some merit, but of course, it has to go through "higher ups". However, they have been very helpful and have pointed me in the direction of a writing a specific script that would enable you to just run that and configure the server to a default point.
I am going to speak more with them about how to pull it off and when done, I will publish the script for use in the CF community.
May 24, 2009 at 5:50 AM Hi.
In the part when you are adding java to your path, it should read:
export JAVA_HOME=/opt/soft/jdk1.6.0_13/
export PATH=$JAVA_HOME/bin:$PATH
instead of:
export JAVA_HOME=/opt/soft/jdk1.6.0_10/
export PATH=$JAVA_HOME/bin:$PATH
note the java version number.
Thanks for this tutorial Mike, I don't know how many hours you must be saving people with this.
Jul 23, 2009 at 8:41 AM Fast Info on how to install java
<pre>
wget http://mad09.net/binary/jdk-6u14-linux-i586.bin
chmod +x jdk-6u14-linux-i586.bin
./jdk-6u14-linux-i586.bin
ln -s /path_to/jdk1.6.0_14/bin/java /usr/bin/java
alternatives --install /etc/alternatives/java java /path_to/jdk1.6.0_14/bin/java 80
</pre>
Sep 9, 2009 at 6:20 AM Hi Mike,
Great series! I'm a n00b on 'nix so greatly appreciated.
My question is with the downloading of the JDK. I'm getting a - couldnt resolve host 'cds.sun.com' message.
Any ideas?
Sep 9, 2009 at 11:03 AM @bill I am not sure why you would be getting that error. I was able to get it to go with the new JDK.
(http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u16-linux-i586.bin?BundledLineItemUUID=F3lIBe.lbgYAAAEjdvYlKJ_F&OrderID=8JBIBe.lakEAAAEjXvYlKJ_F&ProductID=Dx1IBe.prBgAAAEirRcTvuC_&FileName=/jdk-6u16-linux-i586.bin).
Maybe Sun's DNS was messed up or something at that moment, give it another try with the link above and let me know if you are still have troubles.