Wednesday, November 3, 2010

Making Apache talk to Railo

Follow these steps to make Apache talk to Railo [ubuntu]:

sudo -s  ## do everything as root
cd /opt
wget [stable railo ALL-OS WITHOUT JRE from]
tar -zxvf railo-...-without-jre.tar.gz -C .   ## to unpack into the current directory
ln -s railo-..-resin-without-jre railo
/opt/railo/bin/ start  ## to make sure it starts - leave it running
apt-get install apache2 apache2-threaded-dev openjdk-6-jre-headless build-essential automake  ## make sure all of these are installed
vim ~/.bashrc
add this to the bottom and save:  export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
. ~/,bashrc
that re-initialized the bash settings, do this to confirm:
cd /opt/railo/modules/c/src   ##certain directory names are expected here, make sym links to resolve this
ln -s apache2 resin
ln -s resin resinssl
cd /opt/railo
./configure --with-apxs=/usr/bin/apxs2
autoconfig  ## mine errored on make and asked me to run this first then make again
make install

Then in /etc/apache2/httpd.conf  comment out ALL of the caucho lines that were installed there
and place it inside the sites-available config file after the names and directories, before the log files:

LoadModule caucho_module /usr/lib/apache2/modules/
localhost 6800
CauchoConfigCacheDirectory /tmp
CauchoStatus yes

That's it. It's worked a number of times in a row for me on Ubuntu.