SixSigns Blog

Enrich people’s lives and web experience
Ads

Serve CFML applications under Apache directory with Tomcat

In the comment section, about using Open BlueDragon with Tomcat, one user asked: “How do I get tomcat to serve my cfm pages from under an apache virtual server directory or is that not the right way. In other words how does one set up a virtual server running on port 80 if one has never used tomcat before?” I actually wanted to answer to him directly, but then thought I make it a blog entry on its own, since others might be interested as well.

What will follow is my setup with Apache and Tomcat.

1. Have Tomcat running on port 8080 (default).
2. Deploy the openbluedragon.war file.
3. Copy over the “bluedragon” and “WEB-INF” directories to your application.
4. Edit the server.xml file to add a host, like:

<Host name=”openbd.local”>
<Context path=”" docBase=”ABSOLUTEPATHTOYOURAPPLICATION”/>
</Host>

The docBase path can be the application you have already running on your website.

5. Restart Tomcat.

Now what you have to do is to forward any requests to openbd.local from Apache to Tomcat. Tomcat then serves the pages according to the docBase path. In Apache I have it setup like:

<VirtualHost *:80>
ServerName openbd.local
ProxyPass / http://openbd.local:8080/
ProxyPassreverse / http://openbd.local:8080/
HostnameLookups Off
</VirtualHost>

This works perfectly.

The only caveat with this is that each of my applications need a “WEB-INF” and a “bluedragon” folder. Making updating a “pain”. But apparently, this is the best way to serve pages from a J2EE server. Each application has its configuration and you can only enable what you need for that particular application.

Share and Enjoy:
  • Facebook
  • Digg
  • TwitThis
  • Sphinn
  • del.icio.us
  • Mixx
  • Google
  • MisterWong
  • StumbleUpon

If you enjoyed this post, make sure you subscribe to my RSS feed!

Post Metadata

Date
May 18th, 2008

Author
SixSigns

Category

4 Responses to “Serve CFML applications under Apache directory with Tomcat”


  1. I’ve seen quite a few statements regarding the “pain” of configuring BD for each application. I would also like to point out that this can be a nice advantage as well. By that, I mean that I can upgrade one application at a time, instead of a big-bang upgrade on the entire server. Being a sole developer for a large company with a lot of apps to maintain, I simply don’t have the bandwidth to properly convert and QA code for every application running on a particular server. I could see this being an advantage for those with paying customers as well. You may want to use a new version of OpenDB on a server, but not all existing customers are willing to pay for any upgrade costs. This gives a lot more flexibility as now you can run multiple version of OpenBD on the same server.

  2. SixSigns says:

    Yes, if you think about it, it is a very secure and nice way to have a server with different applications running. I mean you then don’t have to worry about the “overhead” of configurations you carry around.

    Like I wrote, it is just a “getting used to it” thingy.

  3. Chris says:

    Is there a way to do this with IIS?

  4. SixSigns says:

    Here is a follow up for getting this to work on IIS/Windows:

    http://www.neurospeech.com/Products/JspISAPI.aspx


Trackbacks/Pingbacks

  1. SixSigns Blog » About Razuna - Open Source Digital Asset Management (DAM) / Open Source Media Asset Management (MAM), Roozani - Organize your information and collaborate with your friends, Open BlueDragon, ColdFusion and Oracle consulting 20 05 08

Leave a Reply