Install railo3.2 in cPanel Server


Install Railo 3.2


Railo 3.2 32bit

root@railo [~]# wget http://www.getrailo.org/down.cfm?item=/railo/remote/download/3.2.1.000/tomcat/linux/railo-3.2.1.000-pl0-linux-installer.run


Railo 3.2 64bit

root@railo [~]# wget http://www.getrailo.org/down.cfm?item=/railo/remote/download/3.2.1.000/tomcat/linux/railo-3.2.1.000-pl0-linux-x64-installer.run


Give executable permission to the bianry file.

root@railo [~]# chmod +x *.run

Execute the binary file to install railo

root@railo [~]# ./railo-*-installer.run


It is better to give the default settings while the installation.

Configure Apache to load Railo


1. Add an additional conf for railo's mod_jk module in apache.
Open apache configuration file (httpd.conf) and add the following entry in it. Here in my case it is '/usr/local/apache/conf/httpd.conf'.

Include conf/mod_jk.conf

2. Add railo configuration entries.
Create a file, '/usr/local/apache/conf/mod_jk.conf' with the following contents in it.

#############################################################

<IfModule !mod_jk.c>
    LoadModule jk_module /usr/lib/httpd/modules/mod_jk.so
</IfModule>

<IfModule mod_jk.c>
    JkMount /*.cfm ajp13
    JkMount /*.cfc ajp13
    JkMount /*.do ajp13
    JkMount /*.jsp ajp13
    JkMount /*.cfchart ajp13
    JkMount /*.cfres ajp13
    JkMount /*.cfm/* ajp13
    JkMount /*.cfml/* ajp13
    # Flex Gateway Mappings
    # JkMount /flex2gateway/* ajp13
    # JkMount /flashservices/gateway/* ajp13
    # JkMount /messagebroker/* ajp13
    JkMountCopy all
    JkLogFile /var/log/httpd/mod_jk.log
</IfModule>

###############################################################

3. You have to distill apache configuration.

root@railo [~]# /usr/local/cpanel/bin/apache_conf_distiller --update
root@railo [~]# /etc/init.d/httpd restart

Check if jk module is loaded with Apache. If it is enabled you will get a result like as follows.

root@railo [~]# httpd -M | grep  jk
 Syntax OK
 jk_module (shared)



Once the installation completed, you can access railo administrator control panel using the following url.

http://<server ip>/railo-context/admin/server.cfm


Enable Railo for a cPanel Account


** Railo is enabling domain basis not account basis. You have to given the document root of your domain in the railo configuration to enable railo.

Here i am showing you how to enable railo for the domain, 'sudosu.in'. Document root of sudosu.in is '/home/sudosu/public_html'.

Open /opt/railo/tomcat/conf/server.xml in your favourite editor like vim or nano and add the following code section in it. There will be a sample code in  /opt/railo/tomcat/conf/server.xml. You can give the following code just below the sample code.

Make changes in the following code by your domain name and it's document root.

<Host name="sudosu.in" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
   <Context path="" docBase="/home/sudosu/public_html" />
   <Alias>www.sudosu.in</Alias>
</Host>


Restart railo service once you have sone the above changes.


root@railo [~]# /etc/init.d/railo_ctl restart

Once you have restarted railo, check if the service is started or not. If there is any errors the service will ne be started and it will show 'No PID found' while checking the railo status.

root@railo [~]# /etc/init.d/railo_ctl status
 * Railo/Tomcat is running (PID: 1979)

If the PID of railo is not running even after restarting railo, you have to check railo log to sort out the issue.
The following log wil help to find the issue.

root@railo [~]# tail -f /opt/railo/tomcat/logs/catalina.out


It will take time to completly UP the railo service, depending upon the number of sites added in server.xml it will vary.
Once you have done the above steps, the following url will be available for you.

http://www.sudosu.in/railo-context/admin/web.cfm

You can create a test cfm page using the following code. Save these contents in test.cfm file and copy it in the document root of the domain and access www.sudosu.in/test.cfm.

Test CFM Page

<cfset myVar="Hello World!">
<cfoutput>#myVar#</cfoutput>
<cfoutput>#Now()#</cfoutput>

Leave a Reply