Installing Lucee on Tomcat 7/OS X
Lucee Server (www.lucee.org) is a new application server that sits on the JVM. The server can be downloaded as a war file and installed on Apache Tomcat (or any other servlet container) with just a few simple steps. This method is based on a blog post by Sean Corfield on installing Railo on Tomcat.
- Download a copy of Apache Tomcat. Let's use the latest version of Tomcat 7 core, available at the Tomcat 7 download page.
- Install Tomcat by extracting the downloaded archive. I will extract the archive to my home folder, /Users/rmunn. For convenience, I rename the resulting folder from apache-tomcat-7.0.59 to tomcat.
- Go into ./tomcat/webapps/. Delete the ROOT folder and ROOT.war.
- Next, go to the Lucee download page on BitBucket and download the latest lucee war file. (You can also clone the Lucee git repository and build Lucee from source, I will cover that in another post).
- Rename the lucee war file to ROOT.war (note the capitalization).
- Copy the renamed ROOT.war file into ./tomcat/webapps.
- Create a directory called lucee in ./tomcat.
- Extract the contents of ROOT.war.
- Go into ./tomcat/webappsROOT/WEB-INF/lib and copy everything in that folder to ./tomcat/lucee.
- Go into ./tomcat/bin.
- Create a file called setenv.sh. Tomcat uses this file to set environment variables on startup. Open the file and add this line:
JAVA_OPTS="-Xms256m -Xmx1024m -XX:MaxPermSize=128m -javaagent:${CATALINA_HOME}/lucee/lucee-inst.jar";
- Go into ./tomcat/conf.
- Open catalina.properties. Replace the commented line in this text with the new line:
#common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar
-
Open web.xml. Add the following code block just above this line:
<!-- ================ Built In Servlet Mappings ========================= -->
-
<servlet> <servlet-name>LuceeCFMLServlet</servlet-name> <description>CFML runtime Engine</description> <servlet-class>lucee.loader.servlet.CFMLServlet</servlet-class> <init-param> <param-name>configuration</param-name> <param-value>/WEB-INF/lucee</param-value> <description>Configuration directory</description> </init-param> <!-- init-param> <param-name>lucee-server-root</param-name> <param-value>.</param-value> <description>directory where lucee root directory is stored</description> </init-param --> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>LuceeAMFServlet</servlet-name> <description>AMF Servlet for flash remoting</description> <servlet-class>lucee.loader.servlet.AMFServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>LuceeFileServlet</servlet-name> <description>File Servlet for simple files</description> <servlet-class>lucee.loader.servlet.FileServlet</servlet-class> <load-on-startup>2</load-on-startup> </servlet>
- Add index.cfm to the index document list at the very end of web.xml.
-
Open a Terminal prompt. Follow these commands: $ cd tomcat/bin $ chmod 775 * $ ./startup.sh
- Next, open a web browser to localhost:8080/lucee/admin/web.cfm. You should see the Lucee Web admin login screen. Lucee is now installed.
Next Steps
From this point you can configure your Tomcat instance and set up your applications in Lucee.