tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Shuck <>
Subject Apache 2.2.4 + Tomcat 6.0.9 using mod_proxy for ColdFusion
Date Mon, 12 Feb 2007 17:19:21 GMT
I have been trying to nail down how to configure the combination of Apache 
2.2.4 + Tomcat 6.0.9 using mod_proxy to pass ColdFusion templates to an 
instance of a ColdFusion server for processing which is loaded as an 
application in Tomcat.  

After some very helpful responses from Pid on the apache-users list, I am 
furthering my discussion here as it appears that my issue lies with my 
misconfiguration (or more aptly un-configuration) of Tomcat to make this 
work.   Below is the conversation that brought me to this list.  

I am clearly open to the answer of 'rtfm', but I have been thusfar unable to 
find the 'm' in which my answer exists.     :)

I would be very grateful for any further advice on this issue.

Dave Shuck wrote:
> I hate to spam up the list with this issue, but I have another question if 
> would indulge me.  To strip this down a bit, let's just forget about the 
> multiple instances and say I have a single instance of Tomcat and have 
> installed ColdFusion as an application within it.   
> So far I have been able to forward .cfm files to ColdFusion via mod_jk and 
> ProxyPass, but neither was in the way that I expected.  I haven't been able 
> to successfully process cfm files with the RewriteRule method.  Perhaps the 
> problem is in my expectation rather than functionality.
> Here is what I would expect to happen.  In Tomcat there is a webapp 
> named "ROOT" which is where the ColdFusion web admin tools and such 
> installed.  It's physical path is /usr/local/apache-tomcat/webapps/ROOT I 
> hit that with http://localhost:8080/......   


> Then in my httpd-vhosts.conf I 
> have a website that is pathed /usr/local/apache2/htdocs/whateversite.  I 
> Ideally I want all my files to exist in the .../htdocs/whateversite 
> and when I hit a .cfm file in that directory, I want that file to be 
> processed by the ColdFusion application.    


> When I used ProxyPass, any request to 'whateversite' would just forward the 
> request to the 'ROOT' site and expect the requested file to exist 
> in .../webapps/ROOT.    Obviously this wasn't the answer.

that's because you told it to...

when the request comes in, you forward the request to tomcat, which 
looked for it in the default application (ROOT) because you haven't told 
Tomcat to look anywhere else.

Apache doesn't send the whole file over to Tomcat for processing, it 
just abdicates responsibility for the requested url and expects Tomcat 
to know what to do with it, and where to find it.

> When I used mod_jk, any non-".cfm" templates would serve properly but when 
> went to serve the ".cfm" templates it would expect those to exist in 
> that "ROOT" directory rather in the "whateversite" directory just as 
> ProxyPass had.  This was closer but still not the answer.

as above you've not configured your Tomcat to know where those files are.

> I haven't yet gotten your suggestion working using RewriteRule, but  would 
> this work as I was expecting where it would not actually re-route the 
> to look for the template in another directory, but actually process the 
> requested template through the application?

it doesn't process the file like a filter, a proxy instruction hands off 
the request for processing by another server, then feeds the results 
back to the client.

> For what it's worth, I added this to the bottom of my httpd.conf file:
> ReWriteEngine on
> RewriteRule  ^\/(.+)\.cfm(.+)? ajp://localhost:8009/$1.cfm$2 [P,L]
> RewriteRule  ^\/(.+)\.cfc(.+)? ajp://localhost:8009/$1.cfc$2 [P,L]
> And this does exist in my Tomcat server.xml:
>     <!-- Define an AJP 1.3 Connector on port 8009 -->
>     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
> When I put request a ColdFusion template it just serves the plain text back 
> from the template sitting in the "whatever" site.  I am not seeing any 
> errors, but it just seems to do nothing with that ".cfm" request.
> Again, I feel like I am just missing something that is probably painfully 
> obvious to others, but after reading and re-reading through the docs I am 
> just not finding the exact answer I am looking for.

Your Tomcat configuration isn't quite right yet.

You need to specify, either a docbase in the ROOT context with all your 
cf? files in it, or add another context and direct all requests to that.

ask about configuring Tomcat webapps on the tomcat-user list & I'll look 
out for you there.

~Dave Shuck

Where's your Spot?

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message