Search:

Apache » Lenya
project logo
  • Project
  • Developer
  • Community
  • Version 2.2
  • Version 2.0
  • Version 1.2
  • Version 2.0
    • FAQs
    • Installation
      • Download
      • Subversion Access
      • Install Instructions
    • Tutorials
      • Create a Publication
      • Create a Resource Type
        • Declaration
        • Creation
        • Presentation
        • Editing (One-Form)
        • Editing (BXE)
      • Implement a Usecase
        • Prerequisites
        • The Usecase
      • Setting up Eclipse
      • Proxying
        • Proxying
        • mod_proxy
        • mod_proxy_ajp
      • Best Practises
      • Production Checklist
      • Writing Tests
    • Concepts
      • Publication
      • Working with Documents
      • Authoring and Live mode
      • WYSIWYG
    • Technical Reference
      • Overview of Lenya Sitemaps
      • Repository
      • Access Control Specification
      • Usecase Framework
        • Overview
        • AbstractUsecase
      • Publications
        • Configuration
        • Publication Templating
      • Resource Types
      • Modules
      • Meta data
      • Protocols
        • lenya Protocol
        • lenya-document Protocol
        • site Protocol
        • lenyadoc Protocol
        • fallback Protocol
      • URLs and Links
        • URL Mapping
        • Link Management
    • Core API
    • Core Modules
      • ac
        • Overview
        • API
      • acusecases
        • Overview
        • API
      • administration
        • Overview
        • API
      • cache
        • Overview
        • API
      • janitor
        • Overview
        • API
      • ldap
        • Overview
        • API
      • linking
        • Overview
        • API
      • observation
        • Overview
        • API
      • properties
        • Overview
        • API
      • sitemanagement
        • Overview
        • API
      • templating
        • Overview
        • API
      • usecase
        • Overview
        • API
      • workflow
        • Overview
        • API
    • Standard Modules
      • blog
        • Overview
        • API
      • bxe
        • Overview
      • cforms
        • Overview
        • API
      • collection
        • Overview
        • API
      • contactform
        • Overview
        • API
      • development
        • Overview
        • API
      • editors
        • Overview
        • API
      • export
        • Overview
        • API
      • fckeditor
        • Overview
        • API
      • kupu
        • Overview
        • API
      • languageselector
        • Overview
      • lenyadoc
        • Overview
        • API
      • linkcheck
        • Overview
        • API
      • links
        • Overview
        • API
      • lucene
        • Overview
        • API
      • migration
        • Overview
        • API
      • navigation
      • neutron
        • Overview
      • news
        • Overview
        • API
      • notification
        • Overview
        • API
      • opendocument
        • Overview
        • API
      • prettyprinting
        • Overview
      • profiling
        • Overview
      • resource
        • Overview
        • API
      • simplesite
        • Overview
        • API
      • sitetree
        • Overview
        • API
      • sourcerepository
        • Overview
        • API
      • svg
        • Rounded Corners
        • Resizing Images
        • API
      • tinymce
        • Overview
        • API
      • usecasedocument
        • Overview
        • API
      • webdav
        • Getting started
        • Monitoring
        • WebDAV Servers
        • API
      • xhtml
        • Overview
        • API
      • xopus
        • Overview

Current Event

Meeting Bad Säckingen 2009

Built with Apache Lenya

Running Lenya Behind Apache with mod_proxy_ajp

Table of Contents
  • Configuring the AJP Connector in Tomcat
  • Configuring the Apache Web Server

Configuring the AJP Connector in Tomcat

The file $TOMCAT_HOME/conf/server.xml contains an AJP 1.3 connector on port 8009 by default:

<Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3"/>

If the connector is not present, you have to add it.

Configuring the Apache Web Server

Now we'll declare the virtual hosts for the Apache web server. This is done in a file called httpd-vhosts.conf. On Mac OS X, it is located in the directory /opt/local/apache2/conf/extra. The contents of the file should look like this:

NameVirtualHost *:80
NameVirtualHost *:443

# This is the non-SSL host for the authoring environment.
<VirtualHost *:80>
    ServerAdmin webmaster@cms.example.com
    ServerName cms.example.com
    ServerAlias cms

    ProxyRequests Off

    RewriteEngine On
    RewriteLog /home/john/src/www/logs/cms.example.com-rewrite_log
    RewriteLogLevel 4
    
    # Redirect the login usecase to https
    RewriteCond %{QUERY_STRING} (.*)lenya\.usecase=ac\.login(.*)
    RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]

    <Location /lenya/>
      ProxyPass ajp://localhost:8009/lenya/
      ProxyPassReverse http://cms.example.com/lenya/
    </Location>

    <Location /modules/>
      ProxyPass ajp://localhost:8009/modules/
      ProxyPassReverse http://cms.example.com/modules/
    </Location>

    <Location /default/modules/>
      ProxyPass ajp://localhost:8009/default/modules/
      ProxyPassReverse http://cms.example.com/default/modules/
    </Location>

    <Location />
      ProxyPass ajp://localhost:8009/default/
      ProxyPassReverse http://cms.example.com/default/
    </Location>

    ErrorLog /home/john/src/www/logs/cms.example.com-error_log
    CustomLog /home/john/src/www/logs/cms.example.com-access_log common
</VirtualHost>

# This is the SSL host for the authoring environment.
<VirtualHost *:443>
    ServerName cms.example.com
    ServerAlias cms

    ProxyRequests Off

    SSLEngine On
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile /home/john/pki/server.crt
    SSLCertificateKeyFile /home/john/pki/server.key

    <Location /lenya/>
      ProxyPass ajp://localhost:8009/lenya/
      ProxyPassReverse https://cms.example.com/lenya/
    </Location> 

    <Location /modules/>
      ProxyPass ajp://localhost:8009/modules/
      ProxyPassReverse https://cms.example.com/modules/
    </Location>

    <Location /default/modules/>
      ProxyPass ajp://localhost:8009/default/modules/
      ProxyPassReverse https://cms.example.com/default/modules/
    </Location>
    
    <Location />
      ProxyPass ajp://localhost:8009/default/
      ProxyPassReverse https://cms.example.com/default/
    </Location>

    ErrorLog /home/john/src/www/logs/ssl.cms.example.com-error_log
    CustomLog /home/john/src/www/logs/ssl.cms.example.com-access_log common

</VirtualHost>

# This is the non-SSL host for the live area.
<VirtualHost *:80>
    ServerAdmin webmaster@www.example.com
    ServerName www.example.com
    ServerAlias www

    ProxyRequests Off

    <Location />
      ProxyPass ajp://localhost:8009/default/live/
      ProxyPassReverse http://www.example.com/default/live/
    </Location>

    ErrorLog /home/john/src/www/logs/www.example.com-error_log
    CustomLog /home/john/src/www/logs/www.example.com-access_log common
</VirtualHost>

Copyright © 1999-2009 The Apache Software Foundation. All rights reserved.