Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Unsupported Software
  • Search

HOWTO: Install Apache-Lenya w/ Tomcat on Gentoo x86

This forum covers all Gentoo-related software not officially supported by Gentoo. Ebuilds/software posted here might harm the health and stability of your system(s), and are not supported by Gentoo developers. Bugs/errors caused by ebuilds from overlays.gentoo.org are covered by this forum, too.
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
cjubon
Guru
Guru
User avatar
Posts: 450
Joined: Tue Jul 03, 2007 8:03 am
Location: Vienna/Europe

HOWTO: Install Apache-Lenya w/ Tomcat on Gentoo x86

  • Quote

Post by cjubon » Sat Feb 23, 2008 7:25 pm

This is a short HOWTO on how to install the Lenya Content Management System version 2.0 on top of a Tomcat server on a Gentoo box. As there is no ebuild for Lenya in the portage tree (nor on o.g.o.), you'll need to install from sources. Installation generally being quite straightforward, there are, however, some caveats. Hence this how-to.

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:

    Code: Select all

    # nano -w /etc/portage/package.mask
    (Add the following line:)
    >=www-servers/tomcat-6
    Now you can run

    Code: Select all

    # emerge -av tomcat
    All 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.
  • 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):

    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();
         }
     }
    
    Copy it into your editor and save it as (e.g.) lenya-2.0-issue43859.patch in your sources directory.

    If you opt for svn checkout of the developer versions, just run

    Code: Select all

    svn co http://svn.apache.org/repos/asf/lenya/trunk lenya-2.0.x
    in an appropriate directory and wait ;-). Of course, you need dev-util/subversion in order to run that command.
Patching Lenya-2.0
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.gz
Apply the patch:

Code: Select all

# cd apache-lenya-2.0
# patch -b -p0 < /path/to/lenya-2.0_issue43859.patch
Configuring Lenya for Gentoo Tomcat
This 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.4
Alternatively, you can copy the file build.properties to local.build.properties, change at least the Tomcat related stuff, and make further changes according to your needs.

Installing Lenya
Now you're almost done: Still inside your lenya source directory, type

Code: Select all

./build.sh
Lenya should build now, and install it's webapp part into /var/lib/tomcat-5.5/webapps/lenya (as defined by our custom local.build.properties file).

Finally, 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/lenya
If you omit that last step, Lenya will throw an "Failure occured during job recovery" error when you launch it.

Launching 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
Mandrake Dec 2001 · Debian "Woody" Aug 2002 · Gentoo Jan 2004 · Funtoo Oct 2009
Top
legine
Guru
Guru
Posts: 555
Joined: Thu May 27, 2004 2:07 pm
Location: Germany

  • Quote

Post by legine » Wed Mar 12, 2008 9:47 pm

nice work.

But i think I miss something here.

On lenya doocumentation it says to use launch.sh

When I try to go to

Code: Select all

http://localhost:8080/lenya/ 
I get the error msg:
the request source (/lenya/) is not aviable.

I did swap the ownership to tomcat:tomcat and set the mode I set to 777.

Ty
Peter
quote from Spaceballs:
Dark Helmet:[...] we were told to comb the desert, so we're combing it! [puts down bullhorn] Find anything yet?!
Soldier: Nothing yet, sir.
Top
cjubon
Guru
Guru
User avatar
Posts: 450
Joined: Tue Jul 03, 2007 8:03 am
Location: Vienna/Europe

  • Quote

Post by cjubon » Thu Mar 13, 2008 9:56 am

Hi, it's nice to see that this post receives its first answer right after 289 visits :-D.
legine wrote:On lenya doocumentation it says to use launch.sh
I cannot find that reference nor any script called "launch.sh" in the lenya sources.
legine wrote:I get the error msg:
the request source (/lenya/) is not aviable.
cjubon wrote:Start or restart tomcat with the usual "/etc/init.d/tomcat-5.5 (re)start" command
legine wrote:I did swap the ownership to tomcat:tomcat and set the mode
cjubon wrote:

Code: Select all

# chown -R tomcat:tomcat /var/lib/tomcat-5.5/webapps/lenya
Or was it something different that was necessary for you?
Thank you for your help to improve this HOWTO!

cheers, cjubon
Mandrake Dec 2001 · Debian "Woody" Aug 2002 · Gentoo Jan 2004 · Funtoo Oct 2009
Top
legine
Guru
Guru
Posts: 555
Joined: Thu May 27, 2004 2:07 pm
Location: Germany

  • Quote

Post by legine » Thu Mar 13, 2008 11:02 pm

Hi, it's nice to see that this post receives its first answer right after 289 visits :-D.

legine hat Folgendes geschrieben:
On lenya doocumentation it says to use launch.sh
Yick!
Yes my fault. I overread it is in the stand alone section, which we dont need.
cjubon hat Folgendes geschrieben:
Code:
# chown -R tomcat:tomcat /var/lib/tomcat-5.5/webapps/lenya


Or was it something different that was necessary for you?
Thank you for your help to improve this HOWTO!
I dont have an Idea. Yes I did this. And I can not deploy lenya into my tomcat 5-5.

Thought I had first tomcat 6 installed before catching that I configured Paludis wrong way :P
Is there a way to increase debug output within Tomcat? I mean Tomcat just says it can not deploy, and thats a bit thin to go on. especially bc I have only installed Tomcat to look at lenya. I have no Idea about it.
Maybe I do need to sdetup a lenya user?
Or maybe I need to install cocoon? ( I am a bit naivly trying your Howto :P)

Well sure thing. But I bet i am just dump again and over read something. -.-
cheers
quote from Spaceballs:
Dark Helmet:[...] we were told to comb the desert, so we're combing it! [puts down bullhorn] Find anything yet?!
Soldier: Nothing yet, sir.
Top
cjubon
Guru
Guru
User avatar
Posts: 450
Joined: Tue Jul 03, 2007 8:03 am
Location: Vienna/Europe

  • Quote

Post by cjubon » Thu Mar 13, 2008 11:45 pm

legine wrote:Maybe I do need to sdetup a lenya user?
No.
legine wrote:Or maybe I need to install cocoon?
No, Cocoon is part of the lenya source package.
Mandrake Dec 2001 · Debian "Woody" Aug 2002 · Gentoo Jan 2004 · Funtoo Oct 2009
Top
mwhipple
n00b
n00b
Posts: 1
Joined: Wed Sep 09, 2009 8:07 pm

Tomcat 6 support

  • Quote

Post by mwhipple » Wed Sep 09, 2009 8:15 pm

The problem with Tomcat 6 is seemingly the moving of the location for endorsed libraries. I've installed Lenya on Gentoo by changing the tomcat.endorsed.dir value in the local.build.properties to use '${tomcat.home.dir}/lib'. The endorsed subdirectory may also be an option (or the ideal option) but I haven't seem to had as much luck with it.
Top
Post Reply

6 posts • Page 1 of 1

Return to “Unsupported Software”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic