how-to: railo / resin installation on ubuntu minimal os

I hope this tutorial will save you a few hours of trouble, it’s a complete step-by-step tutorial of a railo/resin installation on Linux Ubuntu OS.
You’ll be able to deliver cfml via port 8600 and apache-port 80 as well.

If you prefer the german version, click here

First of all, you need some compliler-tools, wget for downloading the sources, the java enviroment and additional apache-modules (for example apxs2).

sudo apt-get install build-essential
sudo apt-get install apache2 sun-java6-jdk
sudo apt-get install wget
sudo apt-get install apache2-threaded-dev

Now go to http://www.getrailo.org/index.cfm/download/ and download the current railo server version (all os version without jre).
In my case this was today:

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

Now move the tarball to /opt/ and extract the tarball:

mv railo-3.1.2.001-resin-without-jre.tar.gz /opt/.
tar -xvzf railo-3.1.2.001-resin-without-jre.tar.gz

Create a symlink and change the user for your convinience:

sudo ln -s railo-3.1.2.001-resin-without-jre railo
sudo chown -R username railo

Grats, Railo and Resin ist installed now. Please start the shellscript:

./opt/railo/bin/httpd.sh

Run the service in background using (currently railo/resin would stop after closing the shell)

./opt/railo/bin/httpd.sh &

Now you can browse to http://domain.com:8600 ant a test page should appear. From here you can navigate to the railo admin located under http://cfml.domain.com/railo-context/admin/web.cfm.

Now we have to explain apache that it should deliver cfml:

cd /opt/railo
sudo ./configure --with-apxs=/usr/bin/apxs2
sudo make
sudo make install

Warning: if an error occures while doing the configure or make, the makefile isn’t right. In that case please got to /opt/railo/ and rename the Makefile.in to Makefile.in.bak. Then rename the Makefile.am to Makefile.in:

root@blabla:/opt/railo# mv Makefile.in Makefile.in.bak
root@blabla:/opt/railo# mv Makefile.am Makefile.in

Then execute an „make clean“ in the directory /opt/railo/ and do the configure,make an make install again, it will run correctly now.
Remember to restart apache:

sudo /etc/init.d/apache2 restart

Now you can access the railo admin via apache, too: http://domain.com/railo-context/admin/web.cfm
Browse to http://domain.de/caucho-status to see the status of mod-caucho.

At least you have to configure the apache vhost and the resin.conf to provide multiple hosts. Here’s an example:

less /etc/apache2/sites-available/default

Define one more virtual host:

<VirtualHost *:80>
ServerName playgroundcfml.domain.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/playground/
<Directory /var/www/playground/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
</VirtualHost>

Restart apache again and create the host entry on your local machine. The last point is to tell resin.conf the host:

less /opt/railo/conf/resin.conf

search for the host definition beginning:

<!-- configures the default host, matching any host name -->
<host id="" root-directory=".">

after the closing </host> you should add:

<host id="playgroundcfml.domain.com">
<root-directory>/var/www/playground</root-directory>
<web-app id="/">
<document-directory></document-directory>
</web-app>
</host>

Furthermore it is important to define the right port in the following tag – here’s the setting how apache webserver will talk to resin server:

<!-- define the servers in the cluster -->
<server id="" address="127.0.0.1" port="6800">
</code>

Resin will discover the changes automatically and restart the service, you'll not to do that on your own.
That's all, enjoy!

4 thoughts on “how-to: railo / resin installation on ubuntu minimal os

Schreibe einen Kommentar