cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@cocoon.apache.org
Subject [Cocoon Wiki] Updated: ApacheModProxy
Date Fri, 22 Oct 2004 00:32:45 GMT
   Date: 2004-10-21T17:32:45
   Editor: ScottKelley <skelley@yahoo.com>
   Wiki: Cocoon Wiki
   Page: ApacheModProxy
   URL: http://wiki.apache.org/cocoon/ApacheModProxy

   no comment

Change Log:

------------------------------------------------------------------------------
@@ -631,3 +631,76 @@
 
 It's a good idea to limit access to the local machine and whatever IPs your debugging from.
  
+---
+
+Notes from ScottKelley
+
+
+  I have a slightly more complex setup than illustrated (Vignette Portal v4 running on Websphere
v4).  I don't have the luxury of all the static images being in one place.  I use a few more
mod_rewrite rules and a server map that I cribbed from some other examples.  While not the
most elegant, it does work for us.
+
+
+{{{
+ RewriteEngine         on
+# for debugging
+#RewriteLog            /tmp/mod_rewrite.log
+#RewriteLogLevel       1
+
+ ProxyRequests         On
+
+# make sure the values in ProxyPassReverse match the dynamic one in RewriteMap file
+ ProxyPassReverse  /  http://10.0.0.1:9101/
+ ProxyPassReverse  /  http://10.0.0.1:9101/
+
+# Make sure that the virtual host name is passed through to the
+# backend servlet container for virtual host support.
+ ProxyPreserveHost On
+
+# Tell mod_mod proxy that it should not send back the body-content of
+# error pages, but be fascist and use its local error pages if the
+# remote HTTP stack is sending an HTTP 4xx or 5xx status code.
+ ProxyErrorOverride On
+
+ RewriteMap    server  rnd:/usr/local/apache/conf/server_pool.conf
+
+# make sure the status page is handled locally
+# and make sure no one uses our proxy except ourself
+ RewriteRule    ^/apache-rproxy-status.*  -  [L]
+ RewriteRule    ^(http|https)://.*          -  [F]
+
+#
+# The S=X lines are critical.  Don't fubar them.
+#
+
+# send jsp to 'dynamic' servers
+# Vignette helpfully scatters them all around
+ RewriteRule   ^/(.*\.(jsp))$         to://${server:dynamic}/$1  [S=5]
+
+# send site to 'dynamic' servers
+ RewriteRule   ^/(site/(.*))$         to://${server:dynamic}/$1  [S=4]
+
+# send centric to 'dynamic' servers
+ RewriteRule   ^/(centric/(.*))$    to://${server:dynamic}/$1  [S=3]
+
+# send binary to 'dynamic' servers
+ RewriteRule   ^/(binary/(.*))$       to://${server:dynamic}/$1  [S=2]
+
+# send console to 'dynamic' servers
+ RewriteRule   ^/(console/(.*))$      to://${server:dynamic}/$1  [S=1]
+
+# send the fat media to 'static' servers
+# we serve the little stuff locally from this apache instance                -
+ RewriteRule   ^/(fatmedia/(.*))$      to://${server:static}/$1
+
+# now proxy the rewritten rules to the right place
+ RewriteRule   ^to://([^/]+)/(.*)      http://$1/$2    [E=SERVER:$1,P,L]
+}}}
+
+
+The server_pool.conf file looks like. These addresses are actually hardware load balanced
to many boxes.
+{{{
+dynamic   10.0.0.1:9101
+static    10.0.0.2:80
+}}}
+
+
+--

Mime
View raw message