As one of the first steps in preparing for new development on BlogCFC, yesterday, I wanted to download and install Railo so the new code can be tested on Railo as we move along.
First, let me say, it has been a while since I worked with Railo and the new installers are amazingly simple. It took only a few minutes to download and install Railo and fire up the Server Admin.
Unfortunately, what I wanted to do next was not as easy...actually...it was easy to accomplish, not so easy to find the information I needed, though. I wanted to create a new 'web context' that pointed to the directory where the new BlogCFC code would reside. I had used the 'Railo Server with Tomcat 7' installer found here and seen in the image below.
Thanx to the extremely patient Charlie Griefer, who pointed me to a blog post from Todd Rafferty, I was able to find enough information for me to be able to piece together what I needed to do. I am posting this mainly for my own future reference.
DISCLAIMER: This is the process I used to get this working. I am new to Tomcat. I am not certain if this is a 'best practice' - and if its not please let me know a better way. Use this at your own risk.
Let's start from the beginning, go to the Railo download page and grab the files 'Railo Server with Tomcat 7' - go ahead...I'll wait. Please note that I am demonstrating how I did this on OS X, on Windows, your mileage may vary
Go ahead an run the installer - it really is pretty easy. When you are done, in the directory you chose to install Railo, you should see a directory structure similar to the image below.
Now that Railo is installed, I needed to do some prep work. Next I added an entry to my HOSTS file for the BlogCFC code.
Next, open up the server.xml file located in the {railo}/tomcat/conf directory - where '{railo}' is the path to the Railo install directory. Look for the section where the <Host> blocks are located and add a new <Host> block like such:
2 <Context path="" docBase="/WebStuff/Sites/BlogCFC6" />
3</Host>
Note:
- The 'name' attribute is the same as the 'domain' name that is specified in the HOSTS file entry we created
- The 'appBase' attribute is the parent directory of your project directory.
I am honestly not sure if this attribute is needed since we are not 'exploding' a .WAR file, but it did not break anything. Can someone from Railo maybe chime in and let us know? - In the <Context /> block, the 'docBase' is the web root of the application.
Next, we need to copy some files to the project web root. Navigate to the {railo}/tomcat/webapps/ROOT directory and copy the WEB-INF directory. Then, paste the WEB-INF directory into the directory you set as the 'docBase' in the <Context /> block above.
Finally, restart Tomcat. On OS X this can be accomplished by running the shutdown.sh and startup.sh files, respectively. These files are located, by default, in the {railo}/tomcat/bin directory. Once Tomcat has restarted you can navigate to http://{host name}:{port number}, where {host name} is the domain name you specified in the HOSTS file and {port number} is the port on which Tomcat is listening - if you used the default value in the installer, this will be 80.
DISCLAIMER (again): This is the process I used to get this working. I am new to Tomcat. I am not certain if this is a 'best practice' - and if its not please let me know a better way. Use this at your own risk.
UPDATE: I heard form Mark Drew and Todd Rafferty, both from the Railo team, and the <Host> entry code was updated to reflect the changes they suggested. Mark also noted that copying WEB-INF is not necessary - when Tomcat is restarted, it will be created automatically. Thanx Mark & Todd!



