Install Liferay 6.0.5 CE WAR on Tomcat 6.0.29 and MySQL as non root webapp and without Tomcat Manager

We will explain how to install Liferay 6.0.5 CE WAR bundle in an existing Apache Tomcat 6.0.29 and MySQL Server as non ROOT webapp and without Tomcat Manager.

1. Download and install Apache Tomcat 6.0.29 standard bundle (with Tomcat Manager included).

2. Copy %TOMCAT_HOME%/webapps/ROOT folder to %TOMCAT_HOME%/webapps/liferay605 folder.

3. Download liferay-portal-6.0.5.war and liferay-portal-dependencies-6.0.5.zip

4. Unzip liferay-portal-6.0.5.war file and copy all content into the new Tomcat Context, in this example will be %TOMCAT_HOME%/webapps/liferay605 folder.

5. Unzip and copy all dependencies to %TOMCAT_HOME%/lib %TOMCAT_HOME%/lib/ext

6. Download and copy 02 extra libraries (jta.jar and mail.jar) to %TOMCAT_HOME%/lib %TOMCAT_HOME%/lib/ext

7. Create liferay605.xml file into %TOMCAT_HOME%/conf/Catalina/localhost folder. It looks like this:

<Context path="" crossContext="true">
  <Resource
    name="jdbc/LiferayPool"
    auth="Container"
    type="javax.sql.DataSource"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/lportal605_db?useUnicode=true&amp;amp;characterEncoding=UTF-8"
    username="root"
    password=""
    maxActive="20"
  />
</Context>

In my case, DB user is “root” with empty password. You must create an empty DB in MySQL before, for example “lportal605_db”.

8. Create portal-ext.properties into %TOMCAT_HOME%/webapps/liferay605/WEB-INF/classes folder. It looks like this:

jdbc.default.jndi.name=jdbc/LiferayPool
portal.ctx=/liferay605

9. If you are using MySQL as database server instead of HSQL, you must copy mysql jdbc lib into %TOMCAT_HOME%/lib %TOMCAT_HOME%/lib/ext folder.

10. Add the code below to %TOMCAT_HOME%/lib/bin/startup.bat or startup.sh:

set JAVA_OPTS=%JAVA_OPTS% -Xmx1024m -XX:MaxPermSize=256m

11. Run startup.bat/sh, you will see in console when liferay creates and populates the portal database automatically. Now, you can open browser window and enter the folow URL http://localhost:8080/liferay605. Use “test@liferay.com” and “test” as user and password respectively.

Configure Tomcat Manager

Sometimes you need to deploy liferay in your favorite hosting provider but It is impossible because you can not change files of root context, in this case you can use only control panel of you ISP o Tomcat Manager.

Tomcat Manager is included in standard Tomcat bundle but by default It is disabled. If you want to enable it, follow the next steps:

1. Edit %TOMCAT_HOME%/conf/tomcat-users.xml

2. Add user, for example:

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="manager"/>
<user username="roger" password="roger" roles="tomcat,manager"/>
</tomcat-users>

3. Run Tomcat and go to http://localhost:8080/manager

4. Enter user and password configured in step 2.

5. Log in to Liferay for example; in Tomcat Manager now you can see an opened session in liferay605 webapp context and to explore values stored in current session.

6. End.

References:

* Installing 5.2 SP3 WAR on Tomcat 6

* Execute Liferay Portal on non ROOT context

@Chilcano

Posted in Linux, Portal
20 comments on “Install Liferay 6.0.5 CE WAR on Tomcat 6.0.29 and MySQL as non root webapp and without Tomcat Manager
  1. jason says:

    I followed the steps listed. However, I could not link to mysql database. Would you please help?

  2. jason says:

    Attached is the startup log. It did not read portal-ext.properties. It did read liferay605.xml.

    Sep 30, 2010 9:13:13 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 687 ms
    Sep 30, 2010 9:13:14 AM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Sep 30, 2010 9:13:14 AM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
    Sep 30, 2010 9:13:14 AM org.apache.catalina.startup.HostConfig deployDescriptor
    INFO: Deploying configuration descriptor host-manager.xml
    Sep 30, 2010 9:13:14 AM org.apache.catalina.startup.HostConfig deployDescriptor
    INFO: Deploying configuration descriptor liferay605.xml
    Loading jar:file:/C:/apache-tomcat-6.0.29/webapps/liferay605/WEB-INF/lib/portal
    impl.jar!/system.properties
    Loading jar:file:/C:/apache-tomcat-6.0.29/webapps/liferay605/WEB-INF/lib/portal
    impl.jar!/portal.properties
    09:13:21,163 INFO [DialectDetector:69] Determining dialect for HSQL Database E
    gine 1
    09:13:21,167 WARN [DialectDetector:84] Liferay is configured to use Hypersonic
    as its database. Do NOT use Hypersonic in production. Hypersonic is an embedded
    database useful for development and demo’ing purposes. The database settings ca
    be changed in portal.properties.
    09:13:21,273 INFO [DialectDetector:49] Using dialect org.hibernate.dialect.HSQ
    Dialect
    09:13:24,432 INFO [PortalImpl:277] Global lib directory /C:/apache-tomcat-6.0.
    9/lib/
    09:13:24,435 INFO [PortalImpl:297] Portal lib directory /C:/apache-tomcat-6.0.
    9/webapps/liferay605/WEB-INF/lib/
    Starting Liferay Portal Community Edition 6.0.5 CE (Bunyan / Build 6005 / Augus
    16, 2010)
    09:13:38,802 INFO [BaseDB:396] Database supports case sensitive queries
    09:13:44,315 INFO [PluginPackageUtil:1109] Reloading repositories

  3. Luis Mas says:

    It worked, but copied portal-ext.properties into ./liferay605/WEB-INF/classes

  4. jason says:

    indeed it worked after move portal-ext.properties as suggested. Thank you so much!

  5. Pham Cong Phu says:

    I followed the steps above. However, if i enter the link http://localhost:8080/liferay6.0.5 on browser the page is blank page. In tomcat command screen i have some error. Please solved my problem.
    Thanks in advance.

    tomcat command screen have some error look likes:

    java.lang.NullPointerException
    log4j:ERROR Error occured while converting date.
    java.lang.NullPointerException
    at java.lang.System.arraycopy(Native Method)
    at java.lang.AbstractStringBuilder.getChars(AbstractStringBuilder.java:3
    28)
    at java.lang.StringBuffer.getChars(StringBuffer.java:201)
    at org.apache.log4j.helpers.AbsoluteTimeDateFormat.format(AbsoluteTimeDa
    teFormat.java:119)
    at java.text.DateFormat.format(DateFormat.java:316)
    at org.apache.log4j.helpers.PatternParser$DatePatternConverter.convert(P
    atternParser.java:444)
    at org.apache.log4j.helpers.PatternConverter.format(PatternConverter.jav
    a:65)
    at org.apache.log4j.PatternLayout.format(PatternLayout.java:502)
    at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:302)
    at org.apache.log4j.WriterAppender.append(WriterAppender.java:160)
    at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)

    at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders
    (AppenderAttachableImpl.java:66)
    at org.apache.log4j.Category.callAppenders(Category.java:206)
    at org.apache.log4j.Category.forcedLog(Category.java:391)
    at org.apache.log4j.Category.log(Category.java:856)
    at com.liferay.portal.log.Log4jLogImpl.error(Log4jLogImpl.java:53)
    at com.liferay.portal.kernel.log.LogWrapper.error(LogWrapper.java:77)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java
    :136)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:206)
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter
    .java:196)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java
    :126)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:206)
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter
    .java:196)
    at com.liferay.portal.servlet.filters.cache.CacheFilter.processFilter(Ca
    cheFilter.java:385)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java
    :123)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:206)
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter
    .java:196)
    at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETag
    Filter.java:45)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java
    :123)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:206)
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter
    .java:196)
    at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processF
    ilter(AutoLoginFilter.java:254)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java
    :123)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp
    atcher.java:646)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(Applica
    tionDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationD
    ispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDis
    patcher.java:302)
    at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.proc
    essFilter(VirtualHostFilter.java:310)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java
    :123)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:206)
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter
    .java:196)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java
    :126)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:206)
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter
    .java:196)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java
    :126)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:206)
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewrit
    eFilter.java:738)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:206)
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter
    .java:196)
    at com.liferay.portal.servlet.filters.threadlocal.ThreadLocalFilter.proc
    essFilter(ThreadLocalFilter.java:35)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java
    :123)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:191)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
    torBase.java:465)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
    ve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
    a:298)
    at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcesso
    r.java:859)
    at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.pr
    ocess(Http11AprProtocol.java:579)
    at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:15
    55)
    at java.lang.Thread.run(Thread.java:619)
    java.lang.NullPointerException

    • Thanks for your information. I have tried all installation process again and problem probably could be JAVA/JDK version.

      I have installed successfully on windows xp with JDK 1.6.x

      Try this, if you can not get run successfully, please, send me your logs and environment details.

      Regards.

      Roger

      • Pham Cong Phu says:

        Hi Roger,
        I have got a few mistake. I copy all root’s contents instead of root folder. I have tried and successfully. This post very helpful for me.

        Thanks Roger!

      • Pham Cong Phu says:

        Hi Roger,

        I am trying on Linux(fedora 12). In the final step. I run startup.sh some problem here. In the terminal screen i have some message look likes:

        ./startup.sh: line 27: uname: command notfound
        ./startup.sh: line 46: dirname: command not found
        Cannot find ./catalina.sh

        Would you please help me?

  6. Jimmy Wong says:

    You may need to modify Catalina.properties to cater the SEVERE: listener problem.

  7. Antony Jeyaprakash says:

    Hi ,

    I followed the all steps that was mentioned above. But this application did not start when i try to start through tomcat manager. It says the error “SEVERE : error listener start” and “start up failed due to previous error”. Is any body there please help me or give another link which describes the installations.

    Thanks
    J.Antony Jeyaprakash
    antonyjeyarprakash@rediff.com

  8. aziz says:

    this error when I use tomcat 6
    FAIL – Application at context path /liferay605 could not be started

  9. Orick says:

    Hi!
    I followed the steps listed. But I get following logs:

    21.05.2011 0:02:29 org.apache.catalina.startup.HostConfig deployDescriptor
    INFO: Deploying configuration descriptor liferay605.xml
    21.05.2011 0:02:30 org.apache.catalina.core.StandardContext start
    SEVERE: Error listenerStart
    21.05.2011 0:02:30 org.apache.catalina.core.StandardContext start
    SEVERE: Context [/liferay605] startup failed due to previous errors

    Would you please help?

  10. […] context and believe me, we've tried exhaustively). Our deployment method for Liferay matches this almost exactly, with the addition of adding dependencies that we're not including in the […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives
%d bloggers like this: