[users@httpd] LocationMatch and RE help Plz

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>

 

Regards,

Douglas WF Acheson


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux