FarCry 5.2 + Railo 3.1.0.16 + Resin + Apache + MySQL + CentOS - Part 2
Right... part 2. We're going to install Railo in this section. It's going to be a much smaller ride than part 1 ;). But first, some knowledge.
I've learned that:
- I'm not a fan of CentOS. I prefer the debian distros. Why? I've not really ever had a need to play with SELinux, or IPTables. Why does that matter? Both of these things have caused me grief whilst putting this together as both are enabled by default in both the _64 and i386 builds of 5.3.
- You must turn off IPTables on each boot of the system. I'm sure there's a way to make this automatic, but I really haven't tracked it down yet. Yes, it would not be an issue if I just set it up... surely this will be a blog posting down the line, but I don't require it for now.
- I had originally done the write up for part 1 with an _64 build. Everything was great until I got to the point where I needed to build mod_caucho. I could not find a way to successfully build that, and it appeared to be an issue with apsx. I didn't really want to spend my entire day chasing down rabit holes, so I switched to the i386 build. It's at this point that I learned that SELinux was preventing Apache from talking to Caucho. Again, not wanting to chase my tail endlessly, I just disabled SELinux for now.
- Use PUTTY! I can never get copy/paste to play nice between my VM command line screen and windows. So, I'll just minimize the VM and use PUTTY to terminal (over SSH) into virtual box. In this way, you can also keep several screens up at one time.
So, on with the show.
NOTE: you MUST use the .012 version of Railo at this time. I'm hosting the file on my site as I cannot find it on the official getrailo.org site.
- Disable SELinux!!!! (or fix it) To disable, use:
- We're now ready to grab the railo install. I'd advise using the railo server All OS (without JRE).
- Change to the home directory (really, anywhere you'd like to dump this file) and run the following. You'll notice that we're grabbing
.015.012 of Railo. We'll discuss how to update to more bleeding edge versions(we need .016)in part 3. - Next, we'll unpack the files from the railo archive. We're going to create a symbolic link called railo for easy reference to the current build. This also means we have a really easy way to update in the future... just change the symbolic link to point to a new/different version.
- Last, we're going to configure railo to work with Apache. I could not get this to complete successfully using the 64 bit version of CentOS... your mileage may vary. When installing JAVA from the RPM download, it places the files (or sym link...) into /usr/java. These paths will only really work on CentOS, fyi. You must run this from within the railo folder. If these commands should fail... well, uh, google is your friend (and so is the railo mailing list). I have the barest working knowledge of how all of this works and can't really offer any help for errors here.
- Start up Railo, and browse to http://<vmware_IP>:8600 to see if Railo/Resin are working. To start Railo, run:
- Restart our Apache server
- You should now be able to test http://<vmware_IP>/caucho-status to ensure that Resin is configured correctly and talking to Apache. You will see an OK status for the Configuration Cluster, and Default Virtual Host (this is where I figured out that SELinux was killing me).
- Browse to http://<vmware_IP>/index.cfm to see the default Railo status page (or at least, that's what we're hoping to see). The file index.cfm is stored in /opt/railo/webapps/ROOT. In the future, this is where we will be placing our FarCry files. Yes, you'd really want to make a new web context for a production server, but this is not a concern for me at this time.
- If you'd like to start Resin with the box, copy the files from /opt/railo/contrib/init.resin file to /etc/init.d/resin (thanks Gert Franz!) then run.
SELINUX=disabled
shutdown -r now
tar -xvf ~/railo-3.1.0.012-resin-without-jre.tar.gz
ln -s railo-3.1.0.012-resin-without-jre.tar.gz/ railo
cd railo
make
make install
chkconfig resin on
Great! We have Resin/Railo/Apache/MySQL and all the base stuff installed and talking nice-nice to each other. I would also suggest you add index.cfm/.cfml as a default document type (I'll add this in part 3) so we don't have to type out the file name in the browser. I'd also expect that we would break the site out to a virtual host directive, but at this point I'm not really all that concerned about doing so. That will likely be addressed in part 5ish when we want to enable friendly URLs.
