Railo 3: JBoss and Apache
This is a translated repost of an article written by Markus Skrabal. I found the article very informative and thought that all the non-German folks might also benefit. This isn't a pure translation as I added my own "voice" as well as added and edited some of the content.
Railo and Apache on JBoss
In order for you to get Apache and Railo to work on JBoss a few modules need to be able to communicate with each other. The installation and setup of those modules is described below.
Foundation
Required Software:
Railo (3.0.0.6), Apache, JBoss, and finally MOD_JKEnvironment:
Install JBoss, Railo and Apache. For instructions on how to install Railo on Jboss you can see my blog post Deploying Railo 3 to JBoss.
Installation/Configuration
With Jboss installed to c:\Jboss and Apache installed to c:\APACHE we can load the MOD_JK connector. After getting the correct version for your environment, in my case version mod_jk-1.2.26-httpd-2.0.59.so, drop it into the c:\APACHE\modules directory and rename it to mod_jk.soThat's it for required software now we can concentrate on the configuration.
Configuring Apache:
Open the httpd.conf file located in the c:\APACHE\conf folder and look for the loadModules block and add the following:# JBOSS Connector LoadModule jk_module modules/mod_jk.soAdd the following to the end of the httpd.conf file:
# Include mod_jk configuration file Include conf/mod_jk.conf
Don't forget to save the file!
Configuring the Connector
Still in the c:\APACHE\conf create a file called mod_jk.conf. Copy the following into your emtpy mod_jk.conf file and save it.# Where to find workers.properties JkWorkersFile conf/worker.properties# Where to put jk logs JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info] JkLogLevel info
# Select the log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
# JkOptions indicates to send SSK KEY SIZE # Note: Changed from +ForwardURICompat. # See http://tomcat.apache.org/security-jk.html JkOptions +ForwardKeySize +ForwardURICompatUnparsed -ForwardDirectories
# JkRequestLogFormat JkRequestLogFormat "%w %V %T"
# You can use external file for mount points. # It will be checked for updates each 60 seconds. # The format of the file is: /url=worker # /examples/*=loadbalancer JkMountFile conf/uriworkermap.properties
# Add shared memory. # This directive is present with 1.2.10 and # later versions of mod_jk, and is needed for # for load balancing to work properly # Note: Replaced JkShmFile logs/jk.shm due to SELinux issues. Refer to # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=225452 JkShmFile run/jk.shm
Configuring the Worker
Create a new file in c:\APACHE\conf called worker.properties and add the following:worker.list=node1Since we only have one JBoss instance installed you only need to specify one worker, with more instances you can specify more workers which allows it to act as a software load balancer. The worker will try to communicate with JBoss over AJP through port 8009.# Define Node1# modify the host as your host IP or DNS name. worker.node1.port=8009 worker.node1.host=localhost worker.node1.type=ajp13 worker.node1.lbfactor=1
Save and close the worker.properties file.
Application Mapping
Create a new file in c:\APACHE\conf with the name uriworkermap.properties and add the following:# Mount your applications /jmx-console=node1 /jmx-console/*=node1 /web-console=node1 /web-console/*=node1 /railo=node1 /railo/*=node1Important: Make sure that in the Railo META-INF directory that the application.xml file contains <context-root>/railo</context-root>
Thats the last of the Apache configurations, now we just need to make a couple changes to JBoss.
Configuring JBoss (4.2.2GA)
In the JBoss deployment folder (
<!-- This is the default JBOSS webserver Port (HTTP) <Connector port="8080" address="${jboss.bind.address}"
maxThreads="250" maxHttpHeaderSize="8192"
emptySessionPath="true" protocol="HTTP/1.1"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" /> -->
We also need to deactivate the HTTPS part
<!--
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" keystoreFile="${jboss.server.home.dir}/conf/ssl.keystore"
keystorePass="mypassword" keyAlias="testkey1"
sslProtocol="TLS" />
-->
and lastly search for the following section and make sure that its NOT commented out.
<Connector port="8009" address="${jboss.bind.address}" protocol="AJP/1.3"
emptySessionPath="true" enableLookups="false" redirectPort="8443" />
<Engine name="jboss.web" defaultHost="node1">
Finishing Up
Finally! we are done. You just need to restart JBoss and Apache and voila Apache will now be your web-server.
Subscribe
Subscribe via RSS
Follow me on Twitter
Or, Receive daily updates via email.
Tags
adobe air ajax apple cf community cfml coldfusion examples ext flash flex google javascript max2007 max2008 misc open source programming railo software technology ui
Recent Entries
No recent entries.
Blogroll
An Architect's View
CFSilence
Rey Bango
TalkingTree

Do you know if these instructions will work for JBoss 5?
I have Ubuntu JBoss 5 RC1 Railo 3005 Apache 2.2.8
My Apache is throwing an error on
uriworkermap.properties
I'm following your tutorial, but I do not have a META-INF folder or an application.xml anywhere underneath my JBoss or railo.war directories. Do you know where I would find this?
This deployment should be for deploying railo as an EAR not a WAR, thanks for catching that, I will have to add the correct instructions for the base install of Railo as an ear on Jboss.
Thanks for this. I have used your instructions, and they work great for ubuntu, and jboss 5
The server.xml is in a different place
You need to use your ear approach rather than the war approach described.
If ou are using virtual directories you need to define a differend file for each virtual directory
took a little while - but is all fine!
- Joel
http://jamiekrug.com/blog/index.cfm/2009/3/3/Railo...
Is there any advantage using the apache http server over using JBOSS' http server?
Following your blog entries I have deployed Railo over JBOSS on Apache webserver on my windows vista.
Now I can access Railo admin from apache (port I have used is 1000 for Apache Installation) like http://localhost:1000/railo/railo-context/admin/we.....
So I feel installation is fine.
Now my biggest issue is how can I configure New Website? I have seen your post http://www.garyrgilbert.com/blog/index.cfm/2008/9/... which is using Resin, but on apache and Jboss how it is done? When I just try to access a .cfm file from apache webroot it is not processing coldfusion file at all.. Please advice?
Thanks
good post.
I am trying Railo 3.1 with jboss 5 and apache 2.2.
I am a noob on apache so .... jboss was running on 8080 an I have deployed railo as war and was running ok.
I added mod_jk with the settings you provided and restarted both jboss and apache...
Now:
localhost:8080 that was jboss do not answer and is ok.
localhost:8888 that is apache answer but do not process cfm
Any suggestion?
Thanks
Andrea
p.s.
I am on vista
It sounds like your virtual host is not actually passing off the calls to .cfm files from Apache to Tomcat. Check your Apache Conf file.
Thanks Andrea
this is my virtual host in apache:
<VirtualHost *>
DocumentRoot "D:/wwwroot/"
ServerName localhost
#Welcome files
DirectoryIndex index.cfm index.php index.htm index.html index.html.var
JkMount /* worker
</VirtualHost>
I still cannot send pages to connector.
Any suggestion?
Andrea
Take a look at this other post of mine that I did with Apache and Tomcat.
http://www.garyrgilbert.com/blog/index.cfm/2009/2/...