While the standalone build of Lenya is good to get started with, it's not really good enough for most production uses. This how-to explains how you can set up Lenya under a more typical production configuration, using Jetty 6 and Apache 2. The example commands are from Debian-style Linux distros; replace with your own if you're not on one.
...and surf to localhost:8080 (or whichever port Jetty is set to run on; some default installs have it at 8280).
Note: I had a problem with a misconfiguration out of the box; I had to comment out the line /etc/jetty/jetty-shared-webapps.xml in /usr/share/jetty/etc/jetty.conf. YMMV.
Put lenya.war or \[LENYA_SRC\]/build/lenya/webapp under \[JETTY_HOME\]/webapps (rename webapp to lenya). |
Copy or link \[LENYA_SRC\]/externals/cocoon_2_1_x/lib/endorsed/jakarta-regexp-1.5.jar under \[JETTY_HOME\]/lib/ext (or put it elsewhere on your classpath). \\ |
Start Jetty and surf to http://locahost:8080/lenya/. You should see the Lenya homepage.
Note: There are lots and lots of ways to set up apache2; this is sort of the simplest case. Check the httpd documentation for more.
Mine looks something like this (replace YOURPUB with your publication, naturally):
<IfModule mod_proxy.c> # Turn off support for true Proxy behaviour as we are acting as # a transparent proxy ProxyRequests Off # Turn off VIA header as we know where the requests are proxied ProxyVia Off # Turn on Host header preservation so that the servlet container # can write links with the correct host and rewriting can be avoided. ProxyPreserveHost On # Set the permissions for the proxy <Proxy *> AddDefaultCharset off Order deny,allow Allow from all </Proxy> # Turn on Proxy status reporting at /status # This should be better protected than: Allow from all ProxyStatus On <Location /status> SetHandler server-status Order Deny,Allow Allow from all </Location> # Make the domain root go to the 'live' area of the YOURPUB publication ProxyPass '' http://localhost:8080/lenya/YOURPUB/live # Find the base resources used for authoring ProxyPass /lenya http://localhost:8080/lenya # Shorten the URL for authoring ProxyPass /authoring http://localhost:8080/lenya/YOURPUB/authoring # Lenya sets a session cookie for /lenya, but we need it at / ProxyPassReverseCookiePath /lenya / </IfModule> |
Note the ProxyPassReverseCookiePath directive – you need one if you mess with the URI paths as above.
Edit \[YOURPUB_HOME\]/config/publication.xml and add the following to the <proxies> node: |
<proxy area="live" ssl="false" url=""/> <proxy area="authoring" ssl="false" url="/authoring"/> |
You can also use full URL's, including the scheme and the domain, for the url attributes.
And that's about it.