Apache Lenya 2.0 Installation Instructions
- Introduction
- Prerequisites
- 1: Standalone Installation (using the built-in Jetty)
- 2: Installation with Apache Tomcat
Introduction
This document explains how to install Lenya 2.0 from source.
There are different ways to install and run Lenya:
Choose between
- Running Lenya standalone using the built-in Jetty servlet container
- Using Tomcat and have the build process taking care of deploying Lenya in Tomcat
Please note that you can use other servlet containers as well, but Jetty and Tomcat are the tested ones.
In all cases, you will need to meet the following prerequisites, that describe the setup that is tested and recommended.
Prerequisites
-
Java 2 Platform, Standard Edition
version 1.4.2 or newer.
Get it from http://java.sun.com. -
Patch command
You will need a patch command available in your path. patch usually comes with most Linux, Unix, and OS X distributions. However, you will probably need to download it for Windows. There are a couple of options including Cygwin and UnxUtils. -
Recommended: Create a directory to better organise the various source files
In this document, we will assume the namesrc/
for that directory. This directory will contain the Lenya distribution as well as Cocoon.After expanding the downloaded archives or after a svn checkout, the directory structure should look like this:
your_home/ (or C:\ on Windows, not the "My Documents" folder) src/ lenya-2.0.x/ $LENYA_HOME externals/ cocoon_2_1_x/ $COCOON_HOME build/ webapp/ $COCOON_WEBAPP
The directories inside
cocoon_2_1_x/
will be created when you build Cocoon, Cocoon will be built when you build Lenya. The variables will later be used in thelocal.build.properties
file that configures the Lenya build process. -
Get Apache Lenya
(see Download Lenya)
Using Subversion, checkout Lenya inside thesrc/
directory.
1: Standalone Installation (using the built-in Jetty)
-
Configure Lenya
You need to edit your build properties and write
local.build.properties
. To do this, executeconfigure.sh
(Unix) orconfigure.bat
(Windows).noteCocoon 2.1.x is now included in the Lenya source tree using an
svn:externals
property; you'll find it in the directory$LENYA_HOME/externals/cocoon_2_1_x
. If you want to use Cocoon from another location, you can change the$COCOON_HOME
point to your Cocoon source directory. -
Build Lenya
Execute
build.sh
(Unix) orbuild.bat
(Windows) in your Lenya source directory, depending on your platform.noteCocoon will be built when you build Lenya. You can manually build or clean Cocoon in
$COCOON_HOME
with./build.sh
or./build.sh clean
.MS Windows
$LENYA_HOME > build.bat
Unix
$LENYA_HOME > ./build.sh
If your build fails, because it cant delete the file
cocoon.xconf.ant_patch
, try the following: In$LENYA_HOME/src/targets/webapp-build.xml
, line 69, addverbose="true" failonerror="false"
to the<delete>
tag. In$LENYA_HOME/src/targets/publets-build.xml
, line 53, addverbose="true" failonerror="false"
to the<delete>
tag. -
Start Lenya
Execute
lenya.sh
(Unix) orlenya.bat
(Windows) in your Lenya source directory, depending on your platform. Make sure that you have the environment variableJAVA_HOME
defined to point to the location of the Java SDK you installed (see Prerequisites).MS Windows
$LENYA_HOME > lenya.bat
Unix
$LENYA_HOME > ./lenya.sh
-
Test the installation
2: Installation with Apache Tomcat
The installation path may not contain spaces, otherwise you may get a
java.net.URISyntaxException
error.
-
Get Apache Tomcat for JDK 1.4
Lenya is developed and tested with Tomcat 5.5 ; it is assumed in the following instructions, and we highly recommend it. Tomcat 4.0.0+, 4.1.24+, 5.0.18+ and 6.0+ should work too.Get it from http://tomcat.apache.org/download-55.cgi
-
Install Apache Tomcat
See Tomcat 5.5 setup
MS Windows:
Basically you only need to set theJAVA_HOME
environment variable and run the Tomcat installer. Decide to run Tomcat as a Windows NT/2000/XP-Service. -
Configure Lenya
To install Lenya with Tomcat, you need to edit your build properties. To do this, copy
$LENYA_HOME/build.properties
to$LENYA_HOME/local.build.properties
.noteYou can use the
configure.sh
orconfigure.bat
to configure yourlocal.build.properties
.Edit
local.build.properties
. For the described configuration the following settings will work ( MS Windows: Don't use backslashes "\
" for directory separation.) It is important thattomcat.home.dir
is an absolute path. Replace$TOMCAT_HOME
by your Tomcat installation directory. If your Cocoon source directory is not at../cocoon_2_1_x
relative to Lenya, then change thecocoon.webapp.dir
,web.app.server
andcocoon.src.dir
properties.-
web.app.server=Tomcat
-
cocoon.src.dir=$COCOON_HOME
-
tomcat.home.dir=$TOMCAT_HOME
-
-
Build Lenya
Execute
build
in your Lenya source directory. -
Checked versions of endorsed libraries
Lenya and Tomcat will inter-operate correctly only if the proper versions of the Xalan and Xerces libraries are used consistently throughout the deployment. Unfortunately this can be difficult to get to work correctly since both of these libraries are shipped with Java 2 SDK, Tomcat, Cocoon and Lenya.
The following libraries must be placed in the endorsed library directory for your deployment.
-
jakarta-bcel-20040329.jar
-
jakarta-regexp-1.5.jar
-
xalan-2.7.0.jar
-
xercesImpl-2.9.0.jar
-
xml-apis-1.3.04.jar
They are placed by the build process in the directory specified by
tomcat.endorsed.dir
inbuild.properties
. You should validate that these files are indeed in the proper location for your deployment. You must then validate that no other instances of these libraries exist in any of the following directories:-
The Java 2 SDK endorsed standards directories. This is
usually
${JAVA_HOME}/lib/endorsed/
. -
Any other location in your Tomcat deployment. Specifically,
check
shared/lib/
,common/lib/
andserver/lib/
. -
Any other location in your Lenya deployment. Specifically,
check
webapps/lenya/WEB-INF/lib/
.
A common symptom of incorrect library version are blank pages after starting Lenya. Try carefully checking the location and version numbers of each of the libraries.
References:
-
-
Clear Tomcat work directory
Tomcat's work cache may not be consistent with your newly installed Lenya. This can lead to any number of errors and exceptions. To prevent this, clear the work directory by executing
build.bat
orbuild.sh
in your Lenya source directory, depending on your platform.MS Windows
$LENYA_HOME > build.bat clean
Unix
$LENYA_HOME > ./build.sh clean
-
Restart Tomcat
Restart Tomcat to load the Lenya webapp.
-
Test the installation
http://localhost:8080/lenya/