As promised on Twitter last week, here's Chris's article on getting Railo running on Rasperry Pi.
Over to Chris...
So you are a lucky owner of a sweet Raspberry Pi, you have a typical broadband connection, some ColdFusion language skills and you would like to take advantage of all these things and roll out a little Web site hosted at home, independently from any hosting provider, and make it available to your family, friends and the rest of the world? That's exactly what I've done and I thought I'd share a step-by-step guide on how my stack has been set up so you can give it a try, amend it and/or improve it.
The guide is inspired by an excellent article by Glyn Jackson on running Railo on Raspberry Pi that I found very useful when I started this exciting journey. However, the set-up described below differs slightly as the current version of Raspbian does not allow to install the official Oracle Java JDK and for that reason I'm going to opt for OpenJDK instead. And also, we don't need to worry about the SSH configuration as it's enabled by default in more recent versions of Raspbian.
Another deviation from Glyn's config is using a wired Internet connection rather than WiFi.
Prerequisites
- Standard broadband connection with a dynamically allocated IP address
If you are in the UK, it can be BT, Virgin or any other popular async broadband option (and if you are lucky enough to have an Internet connection with a static IP address, you might want to skip the section covering Dynamic DNS). - A router configurable to forward traffic on port 80 to a machine on the local network
I tested it with an Apple TimeCapsule and a BT HomeHub but other routers should provide that functionality as well. - Raspberry Pi (Model B) with 512MB of RAM
I haven't tested it on the 256 model but you might like to do it at your own risk. - An SD card with the Raspian GNU/Linux distribution installed on it
A step-by-step guide covering this topic can be found on the eLinux site. You will need direct or SSH access to the box with root permissions.
Setup summary
Possible alternatives | ||
---|---|---|
Hardware | Rasbperry Pi 512MB RAM | |
Operating System | GNU/Linux Raspbian | |
JRE | OpenJDK 1.6 | Oracle Java provided you are running a soft-float ABI distro (e.g. Debian) instead of Raspbian |
Web server | Lighttpd | Nginx |
Application server | Tomcat 7 | Jetty, Resin etc. |
CFML server | Railo 4 jars | Earlier version of Railo, Open BlueDragon (not confirmed). Adobe ColdFusion is unlikely to run on such limited hardware. |
Internet domain provider | DNS Dynamic | There is a number of alternative free and commercial services |
Power
One of the great things about Raspberry Pi is its low power consumption which means having it always on should not ruin your home budget. I'm no expert on the electricity stuff but I'm powering my Pi through a USB cable hooked to the Apple TimeCapsule which acts as our home router and is always on anyway so that means there are two devices plugged to one wall socket. Does this configuration mean a decreased power consumption? I honestly don't know but it's certainly nice to have one extra power socket available.In my case, the Pi is connected to TimeCapsule with two cables as the wired Internet connection is also coming from it (see the picture below).