Hosting Railo websites outside of Tomcat's webapps directory ( war installation )
Was just helping someone install Railo - War installation style with the host outside of the Tomcat's webapps directory and wanted to jot down some of my notes.
Basic Tomcat / War Installation
- I downloaded and installed the latest tomcat to c:\dev\apache\tomcat and systray tomcat service panel.
- I browed to localhost:8080 to make sure it was working.
- I downloaded and renamed the railo-3.1.2.001.war to railo.war
- I dropped the railo.war file into the C:\Dev\apache\tomcat\webapps
- Watched it explode and waited until I was 100% sure it was done.
- Stopped Tomcat. Do not skip this step.
- Moved railo.war somewhere else (keep it! don't delete it!)
- If you do this step when it's running, Tomcat will think you mean to uninstall the app and remove the folder counterpart. Bad idea.
- Started Tomcat
- I browed to http://localhost:8080/railo/ to see if index.cfm was working, but I see that Railo Team changed it to be a cflocation that bounces me here: http://localhost:8080/railo/railo-context/admin/web.cfm
- I opened up index.cfm in my editor and changed it to <cfoutput>#now()#</cfoutput>
- Result: {ts '2009-11-27 08:15:18'}
Learning how to add a new Railo host under Tomcat / War Installation
You want to keep the railo.war file handy. Each
Railo host you need to setup, you'll need the railo.war file to explode
and do all the setup for you.At this time, when you create a host outside of the tomcat's webapp like this, Railo is not installed. The above installation was for "localhost" and installed into the Tomcat's webapps directory. You're essentially creating a new host that needs a new installation. Why would you ever want to do this? If you're interested in running Railo / OpenBD / CF9 / CF8 all on the same Tomcat server and/or if you're interested in making sure that each installation of Railo (or any of the cfml engines) get a unique server instance and the settings cannot bleed across hosts. Please note: If you install it this way, there's more than one Railo server context (each host gets its own http://{host}/railo-context/admin/server.cfm ).
- Stopped Tomcat
- Opened up c:\Windows\System32\drivers\etc\hosts in notepad (or, my favorite, notepad++) -- added "testbed" to 127.0.0.1 list.
127.0.0.1 localhost testbed
- Opened up c:\dev\apache\tomcat\conf\server.xml and added the following:
<Host
name="testbed" appBase="/c:/Dev/websites/" unpackWARs="true"
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="C:/Dev/websites/testbed" />
</Host>
<Context path="" docBase="C:/Dev/websites/testbed" />
</Host>
- I renamed railo.war to testbed.war and dropped it into c:\dev\websites\
- Started up tomcat
- I watched testbed.war explode and create a directory ( c:\dev\websites\testbed )
- Browsed to http://testbed:8080/ - index.cfm has a <cflocation> that sent me to http://testbed:8080/railo-context/admin/web.cfm
- I stopped tomcat and renamed testbed.war back to railo.war and moved it elsewhere.
- I opened up index.cfm in my editor and changed it to <cfoutput>#now()#</cfoutput>
- Result: {ts '2009-11-27 10:02:47'}