httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: [users@httpd] httpd 2.2.4 + mod_proxy + tomcat 6.0.9 + ColdFusion
Date Mon, 12 Feb 2007 10:29:33 GMT
Dave Shuck wrote:
> Pid, I appreciate your response.  I would like to understand this a little 
> better as it is currently just slightly more clear than voodoo magic to me.  
> Is the specification of the port what points it to a specific instance on 
> Tomcat?  If so, I am assuming that I have to create some type of matching 
> piece on the Tomcat side.  Is this correct?  
> Thanks again!
> On Sunday 11 February 2007 12:18:48 Pid wrote:
>> ReWriteEngine on
>> RewriteRule  ^\/(.+)\.cfm(.+)? ajp://localhost:8009/$1.cfm$2 [P,L]
>> RewriteRule  ^\/(.+)\.cfc(.+)? ajp://localhost:8009/$1.cfc$2 [P,L]


(Yes, sorry - dashed a quick reply off as I was heading out.)

mod_rewrite lets you send to a configured proxy.

The rule is designed to capture URLs by file type; the bit before .cfm 
gets the main bit of the path, the bit afterwards captures query string 
and session id data.

ajp:// indicates the protocol (you could also use http:// with the 
mod_proxy_http, but ajp is binary and superior in most cases)

(If you have a cluster - more than one tomcat - let me know)

localhost:8009 - server and port follow, which is a configured tomcat 
instance, to which you pass the path back references.

[P,L] are the mod_rewrite 'proxy' and 'last' rule instructions, 

You can find detailed information about mod_rewrite in the Apache docs. 
  It is worth trying to get your head around the mod_proxy doc.  The 
mod_proxy_ajp documentation is somewhat obscure, as it isn't 
particularly clear that you don't need to do anything to configure it.

The main mod_proxy module accepts all the configuration instructions, 
the sub modules only provide protocol connectivity.

(ie you need mod_proxy_HTTP to: RRule /path HTTP://server:port/path )

The other way to forward requests is, as you mentioned, ProxyPass.
This is useful if you wish to send most requests to a server, but you 
*can* specify which paths not to.


ProxyPass /css 		!  # a wayne's world style suffix 'not'
ProxyPass /javascript 	!  # one per path definition

ProxyPass /		ajp://server/port/ option=value option=value

On to Tomcat: only the ajp connector needs to be active; you can disable 
the http one if you're not going to use it.  you only need to look at 
the ajp connector port number, it should work out of the box.

if you need help with tomcat configuration, join the tomcat-users list 
and ask (me?) for help there.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message