You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ne...@apache.org on 2007/11/08 13:01:38 UTC

svn commit: r593137 - in /lenya/trunk/tools/proxytest: README apache_vhosts.conf jetty6.xml

Author: nettings
Date: Thu Nov  8 04:01:34 2007
New Revision: 593137

URL: http://svn.apache.org/viewvc?rev=593137&view=rev
Log:
updated proxy test scaffold, thanks to michi, jann and andreas for
helpful comments.
please try this to prepare jetty6 migration and to test our proxy code
for regressions as you commit new code.

Modified:
    lenya/trunk/tools/proxytest/README
    lenya/trunk/tools/proxytest/apache_vhosts.conf
    lenya/trunk/tools/proxytest/jetty6.xml

Modified: lenya/trunk/tools/proxytest/README
URL: http://svn.apache.org/viewvc/lenya/trunk/tools/proxytest/README?rev=593137&r1=593136&r2=593137&view=diff
==============================================================================
--- lenya/trunk/tools/proxytest/README (original)
+++ lenya/trunk/tools/proxytest/README Thu Nov  8 04:01:34 2007
@@ -1,27 +1,70 @@
+How to use Jetty 6.x with Lenya
+===============================
+
 If you want to play with Lenya in Jetty 6.1.6, please take a look at jetty6.xml
-and follow the instructions in the comment header.
+and follow the instructions in the comment header. In a nutshell:
+  $LENYA_HOME:> cd tools/jetty-6.1.6
+  $LENYA_HOME:> java -Djava.endorsed.dirs="../../externals/cocoon_2_1_x/lib/endorsed/" \
+                     -jar start.jar ../proxytest/jetty6.xml
+
+It would be nice to upgrade our included Jetty to 6.x real soon now, since
+the current version has a broken AJP connector that makes effective proxy
+testing impossible (it basically means you have to install Tomcat).
+
+Note that test-driving Jetty 6.1.6 is orthogonal to proxy testing; the server 
+configuration includes both ajp://localhost:8009 and http://localhost:8888, 
+so you can just drop it in, replacing the old version, without bothering about the
+proxy stuff. 
 
-Running Jetty 6.1.6 is orthogonal to proxy testing; the server configuration
-includes both ajp://localhost:8009 and http://localhost:8888, so you can
-just drop it in, replacing the old version, without bothering about the
-proxy stuff. Please follow up on bug
-http://issues.apache.org/bugzilla/show_bug.cgi?id=43729 with success and
-problem reports.
+Please follow up on bug
+   http://issues.apache.org/bugzilla/show_bug.cgi?id=43729 
+with success and problem reports.
 
 
-*.*
 
+How to build a proxy test scaffold
+==================================
 
-If you want to put the proxying code to test, start Jetty6. Next get an Apache httpd server
-installed. Then apply the following tweaks:
+The proxy example setting simulates the following situation:
+* A customer wants a company hostname and URLs without Lenya-specific
+  path components for the live site.
+* The server uses name-based virtual hosting with just one IP, i.e.
+  there can only be one SSL vhost, which is shared among several
+  customers. This implies the need for sub-directories in the proxy
+  URL.
+* "authoring" should be ssl-protected. There is no need for a
+  customer hostname here, since it's not publicly visible.
+* Any SSL-protected documents in "live" can be handled by the SSL
+  vhost (not using the company hostname is ok in this case).
+
+The desired customer hostname is customer.example.com, the live site will be
+available as http://customer.example.com.
+
+The SSL vhost is called www.example.com.
+
+The Lenya CMS for our customer is reachable as
+http[s]://www.example.com/lenya/customer/authoring/.
+
+The global proxy for non-publication-specific resources shall be
+http://www.example.com/lenya/.
+
+
+FIXME: The instructions below are currently Linux-specific. 
+Please contribute Windows and MacOS instructions!
+
+
+First of all, start Jetty6 as described above.
+Next get an Apache httpd server 2.2.x or later installed (your distro's 
+packages should be fine). Then apply the following tweaks:
 
 1. Install the bogus SSL keys:
 
-   cp *.pem /tmp
+   cp *.pem /tmp (yes, /tmp. it's just for testing, no need to clutter up
+                  your apache ssl directory)
 
 2. Install an apache configuration for virtual hosts:
 
-   cp apache_vhosts.conf /etc/apache2/vhosts.d 
+   cp apache_vhosts.conf /etc/apache2/vhosts.d (or link it there)
 
    (That's probably distro-specific. Just make sure that the file is being 
    included from your master config file)
@@ -44,30 +87,12 @@
 
 8. ./build.sh clean && ./build.sh
 
-9. Surf to http://localhost:8888 to check what the proxy does. Then try
-   http://www.example.com/lenya/default/authoring/ and 
-   http://customer.example.com.
-
-It doesn't quite work as it should (redirects from the Lenya servlet are
-wrong), but you get the idea.
-
-The proxy example setting simulates the following situation:
-* A customer wants a company hostname and URLs without Lenya-specific
-  path components for the live site.
-* The server uses name-based virtual hosting with just one IP, i.e.
-  there can only be one SSL vhost, which is shared among several
-  customers. This implies the need for sub-directories in the proxy
-  URL.
-* "authoring" should be ssl-protected. There is no need for a
-  customer hostname here, since it's not publicly visible.
-* Any SSL-protected documents in "live" can be handled by the SSL
-  vhost (not using the company hostname is ok in this case).
+9. Surf to http://localhost:8888/webapp to check what the proxy does (look
+   at the page source frequently). Then try
+   http://www.example.com/lenya/default/authoring/ (authoring) and 
+   http://customer.example.com (live).
 
-The desired customer hostname is customer.example.com.
-The SSL vhost is called www.example.com.
-The Lenya CMS for our customer is reachable as
-https://www.example.com/lenya/customer/authoring
-The global proxy for non-publication-specific resources shall be
-http://www.example.com/lenya.
+10. Watch the logs in /tmp/LenyaTest_*.
 
+This should give you a working proxy setup.
 

Modified: lenya/trunk/tools/proxytest/apache_vhosts.conf
URL: http://svn.apache.org/viewvc/lenya/trunk/tools/proxytest/apache_vhosts.conf?rev=593137&r1=593136&r2=593137&view=diff
==============================================================================
--- lenya/trunk/tools/proxytest/apache_vhosts.conf (original)
+++ lenya/trunk/tools/proxytest/apache_vhosts.conf Thu Nov  8 04:01:34 2007
@@ -7,6 +7,13 @@
 LoadModule proxy_ajp_module /usr/lib/apache2/mod_proxy_ajp.so
 
 
+#
+# NOTE: This apache config file should give you a working proxy setup.
+# However, it may not be the most elegant/effective/robust. Please
+# contribute your own experience, so that we can establish a set of
+# best practices for proxied production setups.
+#
+
 <VirtualHost www.example.com:80>
 
   ServerAdmin lenyatest@www.example.com
@@ -24,14 +31,20 @@
   # better to disable this during testing as it can create confusion wrt Lenya's own redirects.
 #  RewriteRule ^/lenya/(.*)/authoring/(.*) https://www.example.com/lenya/$1/authoring/$2 [R]
 
-  # map "customer" to the publication id "default":
-  RewriteRule ^/lenya/customer/(.*) ajp://localhost:8009/webapp/default/$1 [P]
-
-  # this is the proxy for global resources:
-  RewriteRule ^/lenya/(.*) ajp://localhost:8009/webapp/$1 [P]
 
-  ProxyPassReverse /lenya/customer ajp://localhost:8009/webapp/default
-  ProxyPassReverse /lenya ajp://localhost:8009/webapp
+  # map official name "customer" to publication id "default"
+  <Location /lenya/customer>
+    ProxyPass ajp://localhost:8009/webapp/default
+    ProxyPassReverse http://www.example.com/lenya/customer
+    ProxyPassReverseCookiePath /webapp/default /lenya/customer
+  </Location>
+
+  # handle global Lenya resource requests
+  <Location /lenya>
+    ProxyPass ajp://localhost:8009/webapp
+    ProxyPassReverse http://www.example.com/lenya
+    ProxyPassReverseCookiePath /webapp /lenya
+  </Location>
 
   ErrorLog /tmp/LenyaTest_www.example.com-errors
   CustomLog /tmp/LenyaTest_www.example.com-access combined
@@ -62,16 +75,19 @@
   ProxyRequests Off
 
 
-  # map "customer" to the publication id "default":
-  RewriteRule ^/lenya/customer/(.*) ajp://localhost:8009/webapp/default/$1 [P]
-
-  # requests to /lenya are handled by jetty
-  # (that means you can use all other paths, including "/" for
-  # other purposes.
-  RewriteRule ^/lenya/(.*) ajp://localhost:8009/webapp/$1 [P]
-
-  ProxyPassReverse /lenya/customer ajp://localhost:8009/webapp/default
-  ProxyPassReverse /lenya/ ajp://localhost:8009/webapp/
+  # map official name "customer" to publication id "default"
+  <Location /lenya/customer>
+    ProxyPass ajp://localhost:8009/webapp/default
+    ProxyPassReverse https://www.example.com/lenya/customer
+    ProxyPassReverseCookiePath /webapp/default /lenya/customer
+  </Location>
+
+  # handle global Lenya resource requests
+  <Location /lenya>
+    ProxyPass ajp://localhost:8009/webapp
+    ProxyPassReverse https://www.example.com/lenya
+    ProxyPassReverseCookiePath /webapp /lenya
+  </Location>
 
   ErrorLog /tmp/LenyaTest_www.example.com-SSL-errors
   CustomLog /tmp/LenyaTest_www.example.com-SSL-access combined
@@ -102,8 +118,20 @@
   # RewriteRule ^/([^/\.]+)$ $1/ [R]
 
   # all requests to customer.example.com are passed to the live area:
-  RewriteRule ^/(.*) ajp://localhost:8009/webapp/default/live/$1 [P,L]
-  ProxyPassReverse / ajp://localhost:8009/webapp/default/live
+  <Location />
+    # fixme: the trailing slash seems necessary here. looks like an inconsistency in our matchers...
+    ProxyPass ajp://localhost:8009/webapp/default/live/
+    ProxyPassReverse http://customer.example.com
+    ProxyPassReverseCookiePath /webapp/default/live /
+  </Location>
+
+  # handle global Lenya resource requests
+  <Location /lenya>
+    # fixme: the trailing slash seems necessary here. looks like an inconsistency in our matchers...
+    ProxyPass ajp://localhost:8009/webapp/
+    ProxyPassReverse http://www.example.com/lenya
+    ProxyPassReverseCookiePath /webapp /lenya
+  </Location>
 
   ErrorLog /tmp/LenyaTest_customer.example.com-errors
   CustomLog /tmp/LenyaTest_customer.example.com-access combined

Modified: lenya/trunk/tools/proxytest/jetty6.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/tools/proxytest/jetty6.xml?rev=593137&r1=593136&r2=593137&view=diff
==============================================================================
--- lenya/trunk/tools/proxytest/jetty6.xml (original)
+++ lenya/trunk/tools/proxytest/jetty6.xml Thu Nov  8 04:01:34 2007
@@ -22,7 +22,7 @@
                      -jar start.jar ../proxytest/jetty6.xml
   
   The Lenya webapp is now available at http://localhost:8888/webapp/.
-  There are jetty example webapps and some Leny garbarge in the root context which
+  There are jetty example webapps and some Lenya garbarge in the root context which
   should be fixable by being more specific under "webapp deployer" below, but it's quite 
   desirable to have Lenya in a non-root context for testing, to make sure we always use
   correct paths and don't wrongly assume "/".



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org