Java Coldfusion • Computer Engineer
Railo (Resin) Apache and Mac OS X - A FAST Combination
This step by step guide is to show you how to install Railo and create a connector to Apache in Mac OS X. I am now using Railo as my development environment due to its speed and strict coding that I can assign to it. This makes sure that every ColdBox release is what it is supposed to be. I am still amazed at how fast and stable Railo is and I highly encourage you to give it a shot!
Anyways, now for the fun.
1) Download Railo from http://railo.ch/en/index.cfm?treeID=224
I downloaded the All OS download: railo-3.0.1.000-resin-3.1.2-without-jre.zip (39 MB)
Once downloaded I unpacked it and installed it in
2) Remove some windows files, because I am a cleanup freak.
3) Let's compile the apache connector by following these commands, but first cd into the Railo directory via your terminal.
$ ./configure --with-apxs=/usr/sbin/apxs --with-java-home=/System/Library/Frameworks/JavaVM.framework/Home
This should spurt out a long list of compilation checks and please look at my java home as my default jvm in my Mac. Once it finishes it should finish with the following:
config.status: creating Makefile
config.status: creating modules/c/src/Makefile
config.status: creating modules/c/src/common/Makefile
config.status: creating modules/c/src/apache1/Makefile
config.status: creating modules/c/src/apache2/Makefile
config.status: creating modules/c/src/resin_os/Makefile
config.status: creating contrib/init.resin
config.status: executing depfiles commands
This means we are done. So now let's make and install the mod_caucho.so connector.
$ make install
After this, you should be A-OK. The script will copy mod_caucho.so to /usr/libexec/apache2/mod_caucho.so and modify your apache conf with
# mod_caucho Resin Configuration
#
LoadModule caucho_module /usr/libexec/apache2/mod_caucho.so
ResinConfigServer localhost 6800
CauchoConfigCacheDirectory /tmp
CauchoStatus yes
Now it is up to you if you want to configure specifc virtual hosts to use resin or not. Example:
ServerName railo.jfetmac
DocumentRoot /Users/lmajano/Documents/MyDevelopment/
Options Indexes FollowSymLinks MultiViews Includes
DirectoryIndex index.html index.htm login.cfm index.php index.cfm
ResinConfigServer localhost 6800
CauchoConfigCacheDirectory /tmp
CauchoStatus yes
<Location /caucho-status>
SetHandler caucho-status
</Location>
</VirtualHost>
Now we open the /Applications/railo/conf/resin.conf and add a few aliases that map our web application to apache:
<host-alias>railo.mac</host-alias>
<web-app id="/" root-directory="/Users/lmajano/Documents/MyDevelopment" />
</host>
After that just fire up apache and the resin server by running:
After that, the server runs and your application is up and running!!
Update Some people have not been able to compile mod_caucho because Apache is running in 64bit mode and the caucho mod is 32 bit mode. Here is some extra help for you:
Here's how to change your apache to run in 32 bit mode.
From Adobe.com --------------------------------------------- To switch Apache from running in 64-bit to 32-bit on Mac OS X 10.5, do the following:
1. Go to /usr/sbin and make a backup of httpd (for example, httpd.back). 2. Run the following command from the terminal:
sudo lipo httpd -thin i386 -output httpd
3. To confirm the resulting http architecture, from /usr/sbin, run the following command:
file httpd
4. The file command should give httpd:Mach-O executable i386. 5. Restart Apache by running the following command:
sudo ./apachectl restart
6. The conf file (httpd.conf) location remains the same (/etc/apache2).


one small thing. The host-alias is not necessary since you define the host already with the id. The host alias is only then useful if you for instance want the url's www.myrailo.com and myrailo.com to pinpoint to the same web context.
Gert Franz
Railo Technologies GmbH
gert.franz@railo.ch
www.railo.ch
Join our Mailing List
english: http://groups.yahoo.com/group/railo_talk/
linked in: http://www.linkedin.com/e/gis/71368/0CF7D323BBC1
check out my entries:
http://www.garyrgilbert.com/blog/index.cfm/2008/11...
http://www.garyrgilbert.com/blog/index.cfm/2008/11...
It seems that when I compile the apache module it doesnt compile it as 64-bit so apache will not start.
Are you running the built-in Apache install for Leopard?
Yeah, I'm really liking Ralo too. What's cool is that I've also isntalledl CF8 (since it runs off a different port than Railo) and then set up virtual hosts pointing to the same web root -- one that hands off requests to resin and one that doesn't -- and test the same site on CF8 and railo at the same time.
I am running the built-in apache for leopard, are you running a standalone version?
On the resin docs it mentions that apache has to be compiled with the mod_so directive.
More information can be found here:
http://caucho.com/resin/doc/install-apache.xtp
@Gert
Thanks for the pointer, I need to catch up on my resin docs, I am reading now for performance tuning.
@Gary,
First of all, it was truly nice meeting you in Germany! I read your blog and never knew it was you!! Go figure! Anyways, yes, it is very similar, just the locations are different. I had a hell of a time just figuring out that the mod_caucho.so was in the /usr/libexec/apache2 directory. I went nuts for about 1 hour finding out about it!!
@Tony,
I do the same thing, now I will be doing some load tests and see how both match up.
Did you get yours figured out?
I have the default apache install & I may have the same issue as you. There were a lot of permission issues but got through those but when trying to start apache i get this in the console:
12/6/08 5:07:08 PM org.apache.httpd[8108] httpd: Syntax error on line 506 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/mod_caucho.so into server: dlopen(/usr/libexec/apache2/mod_caucho.so, 10): no suitable image found. Did find:\n\t/usr/libexec/apache2/mod_caucho.so: mach-o, but wrong architecture
No I havent. I have the same setup, default Apache install in Leopard and I am getting the same exact error you are.
Ok Russ I got it.
Here is the steps
1. Downloads current Apache
2. Uncompressed it to desktop
3. I use path finder so I just went into uncompressed apache folder and opened terminal which opens up already cd'd into the directory. You could also just use terminal to cd into the directory.
4. I wanted to use the default apache locations for leopard (basically re installing over the original files). You can do this by calling the layout file when compiling and choosing the "Darwin" layout which is what leopard uses. Then run this :
./configure --enable-layout=Darwin\
--enable-mods-shared=all \
--with-ssl=/usr \
--with-mpm=prefork \
--disable-unique-id \
--enable-ssl \
--enable-dav \
--enable-cache \
--enable-proxy \
--enable-logio \
--enable-deflate \
--with-included-apr \
--enable-cgi \
--enable-cgid \
--enable-suexec
5. then run:
make
6. then run (with sudo which should allow it to write the info to the files that you are getting permission denials on):
sudo make install
Apache is now done.
Now start with Railo
Do what Luis has but when you are doing the make install do this again:
make
sudo make install
now check and see if the mod_caucho is there and then check httpd.conf to see if it added the resin code to the bottom of it.
Then do your apache virtualhost
then do your resin config
when you add the host code wrap it in server tags and i put it at the bottom like so:
<server>
<host id="railotest.site">
<web-app id="/" root-directory="/Users/Dave/Sites/railotest" />
</host>
</server>
</resin>
the in terminal start resin(from /Applications/railo):
./bin/httpd.sh
*** NOTE
leave terminal open at this point because if you close it resin will stop
***
then browse to see railo running:
http://127.0.0.1:8600/
So next item is to keep resin running