You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/06/14 12:53:58 UTC

svn commit: r547213 - in /lenya/docu/src/documentation/content/xdocs: docs/1_4/tutorials/proxy.xml site.xml

Author: andreas
Date: Thu Jun 14 03:53:57 2007
New Revision: 547213

URL: http://svn.apache.org/viewvc?view=rev&rev=547213
Log:
Added proxying tutorial

Added:
    lenya/docu/src/documentation/content/xdocs/docs/1_4/tutorials/proxy.xml
Modified:
    lenya/docu/src/documentation/content/xdocs/site.xml

Added: lenya/docu/src/documentation/content/xdocs/docs/1_4/tutorials/proxy.xml
URL: http://svn.apache.org/viewvc/lenya/docu/src/documentation/content/xdocs/docs/1_4/tutorials/proxy.xml?view=auto&rev=547213
==============================================================================
--- lenya/docu/src/documentation/content/xdocs/docs/1_4/tutorials/proxy.xml (added)
+++ lenya/docu/src/documentation/content/xdocs/docs/1_4/tutorials/proxy.xml Thu Jun 14 03:53:57 2007
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2006 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- $Id: metadata.xml 55543 2004-10-26 00:14:59Z gregor $ -->
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" 
+  "http://forrest.apache.org/dtd/document-v20.dtd">
+<document>
+  <header>
+    <title>Running Lenya Behind a Proxy</title>
+  </header>
+  <body>
+    
+    <section>
+      <title>Introduction</title>
+
+      <p>
+        This tutorial aims at getting you started with a proxy environment.
+        We're using Apache HTTPD 2.2 with the <em>mod_proxy</em> module. You'll find
+        a lot of documentation on the web how to set up the web server on your
+        machine.
+      </p>
+      <p>
+        Our goal is to run three virtual servers on your local machine:
+      </p>
+      <ul>
+        <li><em>cms.example.com</em> - the authoring environment of your publication</li>
+        <li><em>www.example.com</em> - the actual live site</li>
+        <li><em>lenya.example.com</em> - server for shared resources (Lenya CSS, modules etc.)</li>
+      </ul>
+      <p>
+        Your administrators, editors etc. will use the URL <em>http://cms.example.com</em>
+        to connect to the authoring environment. For the sake of simplicity we'll use
+        the default publication in our example, and we won't cover SSL encryption yet.
+      </p>
+    </section>
+    
+    <section>
+      <title>Declaring the Hosts</title>
+      <p>
+        To tell your system that the <em>example.com</em> domains run on your local machine,
+        open your <code>hosts</code> file, usually located at <code>/etc/hosts</code>,
+        and add the following lines:
+      </p>
+      <source xml:space="preserve"><![CDATA[127.0.0.1       cms.example.com
+127.0.0.1       www.example.com
+127.0.0.1       lenya.example.com]]></source>
+    </section>
+    
+    <section>
+      <title>Configuring the Apache Web Server</title>
+      <p>
+        Now we'll declare the virtual hosts for the Apache web server. This is done in
+        a file called <code>httpd-vhosts.conf</code>. On Mac OS X, it is located in the directory
+        <code>/opt/local/apache2/conf/extra</code>. If you're using Jetty on port 8888, the
+        contents of the file should look like this:
+      </p>
+      <source xml:space="preserve"><![CDATA[NameVirtualHost *:80
+
+<VirtualHost *:80>
+    ServerAdmin webmaster@cms.example.com
+    ServerName cms.example.com
+    ServerAlias cms
+    ProxyRequests Off
+    RewriteEngine On
+    RewriteLog /Users/john/src/www/logs/cms.example.com-rewrite_log
+    RewriteLogLevel 9
+    RewriteRule ^/([^/\.]+)$ $1/ [R]
+    RewriteRule ^/(.*) http://cms.example.com:8888/default/authoring/$1 [P,L]
+    ProxyPassReverse / http://cms.example.com:8888/default/authoring/
+    ErrorLog /Users/john/src/www/logs/cms.example.com-error_log
+    CustomLog /Users/john/src/www/logs/cms.example.com-access_log common
+</VirtualHost>
+
+<VirtualHost *:80>
+    ServerAdmin webmaster@www.example.com
+    ServerName www.example.com
+    ServerAlias lenya
+    ProxyRequests Off
+    RewriteEngine On
+    RewriteLog /Users/john/src/www/logs/www.example.com-rewrite_log
+    RewriteLogLevel 9
+    RewriteRule ^/([^/\.]+)$ $1/ [R]
+    RewriteRule ^/(.*) http://www.example.com:8888/$1 [P,L]
+    ProxyPassReverse / http://www.example.com:8888/
+    ErrorLog /Users/john/src/www/logs/www.example.com-error_log
+    CustomLog /Users/john/src/www/logs/www.example.com-access_log common
+</VirtualHost>
+
+<VirtualHost *:80>
+    ServerAdmin webmaster@lenya.example.com
+    ServerName lenya.example.com
+    ServerAlias lenya
+    ProxyRequests Off
+    RewriteEngine On
+    RewriteLog /Users/john/src/www/logs/lenya.example.com-rewrite_log
+    RewriteLogLevel 9
+    RewriteRule ^/([^/\.]+)$ $1/ [R]
+    RewriteRule ^/(.*) http://lenya.example.com:8888/$1 [P,L]
+    ProxyPassReverse / http://lenya.example.com:8888/
+    ErrorLog /Users/john/src/www/logs/lenya.example.com-error_log
+    CustomLog /Users/john/src/www/logs/lenya.example.com-access_log common
+</VirtualHost>]]></source>
+
+      <p>
+        If you're using Tomcat on port 8080 with Lenya in the context path <em>lenya14</em>,
+        you have to change the port and add the context path accordingly: 
+      </p>
+      <source xml:space="preserve"><![CDATA[    RewriteRule ^/(.*) http://cms.example.com:8080/lenya14/default/authoring/$1 [P,L]
+    ProxyPassReverse / http://cms.example.com:8080/lenya14/default/authoring/]]></source>
+      <p>
+        The Apache web server can now be restarted using
+      </p>
+      <source xml:space="preserve">$ sudo apachectl restart</source>
+    </section>
+    
+    <section>
+      <title>Configuring the Publication for Proxying</title>
+      <p>
+        When you use a proxy, Lenya has to convert all internal links accordingly.
+        Therefore you have to tell the publication about the proxy configuration.
+        Open the file <code>pubs/default/config/publication.xml</code> and uncomment
+        and modify the <code><![CDATA[<proxies/]]></code> section:
+      </p>
+      <source xml:space="preserve"><![CDATA[<proxies ssl="false" root="http://lenya.example.com">
+  <proxy ssl="false" area="authoring" url="http://cms.example.com"/>
+  <proxy ssl="false" area="live" url="http://www.example.com"/>
+</proxies>
+      ]]></source>
+      <p>
+        After re-deploying the publication and restarting your servlet container,
+        you should be able to access the
+        authoring environment of the default publication at the URL
+        <a href="http://cms.example.com/">http://cms.example.com/</a>.
+      </p>
+    </section>
+    
+  </body>
+</document>
\ No newline at end of file

Modified: lenya/docu/src/documentation/content/xdocs/site.xml
URL: http://svn.apache.org/viewvc/lenya/docu/src/documentation/content/xdocs/site.xml?view=diff&rev=547213&r1=547212&r2=547213
==============================================================================
--- lenya/docu/src/documentation/content/xdocs/site.xml (original)
+++ lenya/docu/src/documentation/content/xdocs/site.xml Thu Jun 14 03:53:57 2007
@@ -144,6 +144,7 @@
         <newResourceTypePart5 href="part5.html" label="Editing (BXE)"/>
       </newResourceType>
       <setupide href="setupide/index.html" label="Setting up Eclipse"/>
+      <proxy href="proxy.html" label="Setting up a Proxy"/>
       <tests href="tests.html" label="Writing Tests"/>
       <bestpractises href="bestpractises.html" label="Best Practises"/>
       <production-checklist href="production.html" label="Production Checklist"/>



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