httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Douglas Acheson" <douglas.ache...@bpsserver.com>
Subject RE: [users@httpd] LocationMatch and RE help Plz
Date Thu, 09 Mar 2006 15:55:43 GMT
Just an update to this.  The problem is that proxypass does not work inside
the locationmatch, that is proxypass cannot evaluate a RE.  You need to use
rewriterule to achive this task.  Here is an example:
 
 
	RewriteEngine On
	
  <Proxy balancer://myCluster>
      BalancerMember ajp://10.0.0.152:8009 loadfactor=100 route=152
      ProxySet stickysession=JSESSIONID
      Order Deny,Allow
      Allow from all
  </Proxy>

	RewriteRule (^/myproject/(.+\.(jsp|html|form)))
balancer://myCluster$1 [p]

	ProxyPassReverse /myproject ajp://10.0.0.152:8009/myproject

  <Location /balancer-manager>
      SetHandler balancer-manager
      Order Deny,Allow
      Allow from all
  </Location>

Hope that helps some people ...

Regards,
Douglas WF Acheson
 

________________________________

From: Douglas Acheson [mailto:douglas.acheson@bpsserver.com] 
Sent: Wednesday, March 01, 2006 12:24 PM
To: users@httpd.apache.org
Subject: [users@httpd] LocationMatch and RE help Plz


Hello,

I am having an issue with LocationMatch and PCREs :-(. Here is the scenario.
I am using Apache httpd as a loadbalancer between two tomcat instances,
which is working fine. Now I want to have the web server serve up all static
content, and tomcat server up JSPs and the other dynamic content. So I read
the docs and decided that the LocationMatch directive would server my needs
best. Below is the snippet of config for this. My intent is to have all .jsp
and .frm with the context /myproject be served from the tomcat instances,
all other requests httpd would server up. Any help would be appreciated.

 

# include the proxy module if not already loaded <IfModule !proxy_module>

LoadModule proxy_module modules/mod_proxy.so </IfModule>

# include the proxy http module if not already loaded # this requires proxy
module be loaded first <IfModule !proxy_ajp_module>

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so </IfModule>

# include the proxy balancer module if not already loaded # this requires
proxy module be loaded first <IfModule !proxy_balancer_module>

LoadModule proxy_balancer_module modules/mod_proxy_balancer.so </IfModule>

#
----------------------------------------------------------------------------
#

# Define the tomcat load balancer #

#
----------------------------------------------------------------------------
#

<IfModule proxy_balancer_module>

ProxyRequests Off

# list each member element with the loadfactor

# the sum of each load factor must equal 100

# the route key's value must match the jvmRoute key's value found in the
server.xml

# file for Tomacat

<Proxy balancer://myCluster>

BalancerMember ajp://10.0.0.8:11009 loadfactor=100 route=jvm1

BalancerMember ajp://10.0.0.9:11009 loadfactor=100 route=jvm2

Order Deny,Allow

Allow from all

</Proxy>

<Location /balancer-manager>

SetHandler balancer-manager

Order Deny,Allow

Allow from all

</Location>

<LocationMatch "^/myproject/(.*)\.(jsp|frm)$">

# the stickysession key's value must be JSESSIONID as this is the

# cookie tomcat uses to store the http session.

ProxyPass balancer://myCluster/myproject stickysession=JSESSIONID

ProxyPassReverse balancer://myCluster/bpsproject

Order Deny,Allow

Allow from all

</LocationMatch>

</IfModule>

<mailto:users@httpd.apache.org>  

Regards,

Douglas WF Acheson




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message