#!/bin/sh
JAVA_OPTS="-XX:PermSize=96M -Xmx196m"; export JAVA_OPTS
JAVA_HOME=/opt/java6; export JAVA_HOME
This file is automatically run by Tomcat at startup to set various environment variables. Remember to make it executable!
I wanted Tomcat to start at boot time on the VPS so I created /etc/init.d/tomcat containing:
JAVA_OPTS="-XX:PermSize=96M -Xmx196m"; export JAVA_OPTS
JAVA_HOME=/opt/java6; export JAVA_HOME
#!/bin/sh
/opt/tomcat/bin/startup.sh > /dev/null
Again, don't forget to make it executable! Then I added a symbolic link in /etc/rc3.d/ (which is how other startup scripts are managed):
/opt/tomcat/bin/startup.sh > /dev/null
ln -s /etc/init.d/tomcat /etc/rc3.d/S90tomcat
I restarted the VPS and confirmed Tomcat was running. Yay! Following the Railo + Tomcat procedure from my earlier posts, I deployed Railo and tested that. I configured the datasource, mappings and so on that my site needs.
I shutdown Tomcat, renamed ROOT to welcome and made the change to server.xml so that Tomcat's web root for the empty context was where my main site is deployed. After restarting Tomcat, I was able to browse to my blog (on port 8080) and navigate to other sections of my site. Yay!
Then I removed the unused web applications from the Tomcat webapps folder (remember I said you should do that in production?).
Side note: I use a very old version of BlogCFC (3.5.2) and when testing my site locally, I discovered a small incompatibility in how parseDateTime() handles dates, between CFMX7 and Railo. BlogCFC assumes you can parse strings like "3 31, 2009 11:59PM" but Railo does not like that. I changed the string format to look like "2009-31-3 23:59:59" and that solved the problem. This was the only CFML compatibility issue I have encountered so far getting my site running on Railo.Next, I connected Apache to Tomcat, following my own mod_proxy instructions (except that I don't yet have AJP enabled in Apache - that's on my 'todo' list) and made the changes necessary to read URL.PATH_INFO instead of CGI.PATH_INFO. Finally I disconnected JRun from Apache (by commenting out the JRun connector directives) and removed all the CFMX7-related symbolic links from the /etc/rc*.d/ folders. I restarted the VPS and here is corfield.org running on Railo / Tomcat / Java 6!

10 responses so far ↓
1 Jean Moniatte // Mar 28, 2009 at 8:53 PM
One question: what made you choose Railo (vs CFMX and BlueDragon)?
2 Brad Wood // Mar 28, 2009 at 11:10 PM
3 Andy Allan // Mar 29, 2009 at 12:08 AM
And just a little point, which I'm sure many people have considered themselves, but because of the low overhead of running Railo in comparison to CF8, it makes perfect sense to run our blogs on Railo, and there's no reason why hosting companies can't take advantage of this because you could easily configure multiple Railo webs and still not get close to the memory requirements of CF8 (plus the fact Railo works SO much better in a shared environment that CF).
4 Gary Gilbert // Mar 29, 2009 at 3:48 AM
Welcome to the Railo Club :) I've been on Railo since just before Christmas and with my own VPS it's a nice feeling.
5 Sean Corfield // Mar 29, 2009 at 11:26 AM
@Brad, I still have CFMX7/Java 1.4.2 installed but I don't have it running. It would be easy to switch back, of course.
@Andy, yes, Railo's support for shared hosting - where each account can have its own web administrator but the hosting company can still control the overall server settings - is very impressive. The memory and disk usage is also a factor: compare 490MB (CFMX7 installed) with 150MB (Java 6 + Tomcat 6 + Railo installed), for example.
6 Sean Corfield // Mar 29, 2009 at 11:34 AM
7 salomoko // Apr 1, 2009 at 8:33 AM
where's your VPS getting managed?
8 salomoko // Apr 1, 2009 at 8:35 AM
9 Siraj Sayeed // Jun 30, 2009 at 8:57 AM
I was trying to parse a date with ParseDateTime("06/27/2009 12:00 PM") and railo returns {ts '2009-06-28 00:00:00'} where as CF8 processes it correctly. "11:59 PM" or "12:01 PM" are done correctly. Do you think its a bug or some time related settings?
10 Sean Corfield // Jun 30, 2009 at 10:19 AM
Leave a Comment