Introduction:
Lenya is a CMS originally developped for the "Neue Zürcher Zeitung", a Swiss German language quality newspaper, under the name of Wyona. In 2003 the project has been open-sourced and donated to the Apache Software Foundation. Whereas other open-source CMSs are either based on PHP (Typo3, Joomla, ...) or on Python (Zope/Plone), Lenya is based on Java. The Java framework used for Lenya, also developped by the Apache Software Foundation, is called Cocoon. In order to successfully develop a web site on Lenya, you need at least basic knowledge on how to develop web-applications in Java.
Lenya can be run as a stand-alone application, using its own built-in http server (which is called "Jetty"), or on top of the apache "Tomcat" server, a fully Java based web application server. It can even use yet other servers, but this will not be covered by this how-to. We concentrate on how to build Lenya for a tomcat environment.
Prerequisites:
- You need a clean install of Java and Apache Tomcat. This can easily be achieved on Gentoo, since everything is in portage. Note, however, that Lenya will not run on current Tomcat 6. You need to install a lower version. The ebuilds from the 5.5-branch should all work. So, first thing to do:Now you can run
Code: Select all
# nano -w /etc/portage/package.mask (Add the following line:) >=www-servers/tomcat-6All the dependencies of Lenya, including sun-jdk-1.4*, should be pulled in automatically. Note that the sun jdk-1.4 will have to be downloaded manually, just follow the instructions in the emerge messages. If you're new to tomcat, you can install additional documentation, an admin web interface, and examples, by activating the doc, admin, and examples USE flags, respectively. Note that there are known security issues with the admin and examples extensions, however.Code: Select all
# emerge -av tomcat - Second, you need Lenya. You can either download the release version or checkout the development version from svn. Currently, the official release will have to be patched in order to build correctly. The svn-version is already patched, but download will be approximately 212 MB instead of 55 MB for the tarball.
If you opt for the current official release, you can get it from here: http://www.apache.org/dyn/closer.cgi/le ... src.tar.gz
You'll need the following patch (modified from http://issues.apache.org/bugzilla/attac ... i?id=21126):Copy it into your editor and save it as (e.g.) lenya-2.0-issue43859.patch in your sources directory.Code: Select all
Index: src/modules-core/ac/java/src/org/apache/lenya/ac/impl/CredentialImpl.java =================================================================== --- src/modules-core/ac/java/src/org/apache/lenya/ac/impl/CredentialImpl.java (revision 595021) +++ src/modules-core/ac/java/src/org/apache/lenya/ac/impl/CredentialImpl.java (r595021_patched) @@ -107,6 +107,7 @@ } public int hashCode() { - return Integer.valueOf(getAccreditable().hashCode() + getRole().hashCode()).hashCode(); + Integer integer = new Integer(getAccreditable().hashCode() + getRole().hashCode()); + return integer.hashCode(); } }
If you opt for svn checkout of the developer versions, just runin an appropriate directory and waitCode: Select all
svn co http://svn.apache.org/repos/asf/lenya/trunk lenya-2.0.x
. Of course, you need dev-util/subversion in order to run that command.
This step is only necessary if you decided to use the official release version 2.0. The upcoming version 2.0.1 will already contain the fix.
Unpack the tarball into your sources directory. We assume /usr/local/src/ for this in this guide, hence you need superuser priviledges. ~/programs/src/ would be another possibility.
Code: Select all
# cd /usr/local/src
# tar -xzvf /path/to/apache-lenya-2.0-src.tar.gzCode: Select all
# cd apache-lenya-2.0
# patch -b -p0 < /path/to/lenya-2.0_issue43859.patchThis step is necessary because Tomcat on Gentoo is spread across multiple directories (in order to comply with FHS and Gentoo standards). You may read the Gentoo Tomcat guide for more information: http://www.gentoo.org/proj/en/java/tomcat-guide.xml.
Assuming you're inside the apache-lenya-2.0 source directory, fire up your favorite editor and save these lines as file local.build.properties
Code: Select all
build.properties.version=594644
web.app.server=Tomcat
tomcat.home.dir=/usr/share/tomcat-5.5
tomcat.webapps.dir=/var/lib/tomcat-5.5/webapps/lenya
tomcat.cache.dir=/var/run/tomcat-5.5/Catalina/localhost/lenya
# Comment out if you don't want allow uploads
enable.uploads=true
src.java.version=1.4Installing Lenya
Now you're almost done: Still inside your lenya source directory, type
Code: Select all
./build.shFinally, you have to give tomcat write access to /var/lib/tomcat-5.5/webapps/lenya/WEB-INF/db. This is most conveniently be done by:
Code: Select all
# chown -R tomcat:tomcat /var/lib/tomcat-5.5/webapps/lenyaLaunching Lenya
Start or restart tomcat with the usual "/etc/init.d/tomcat-5.5 (re)start" command and visit your shiny new Lenya installation at http://localhost:8080/lenya/
Have fun
cjubon

