Thursday, March 11, 2010

Installing Liferay 5.2.3 on Existing Apache Tomcat 6.0.24

1. Download and install Apache Tomcat 6.0.24 into your preferred directory.

2. Download and install JDK 5 . Set an environment variable called %JAVA_HOME% (in Windows) or $JAVA_HOME (in Linux/UNIX) to point to your JDK directory.


3. Create and edit $TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml to set up the portal web application.
<Context path="" debug="0" reloadable="true" cookies="true" crossContext="false" privileged="false" />


4. Download liferay-portal-5.2.3.war.


5. Download Liferay's Portal 5.2.3 Dependencies.

5.1. Create a $TOMCAT_HOME/lib/ext directory and unzip the dependencies ZIP in there.

6. Edit $TOMCAT_HOME/conf/catalina.properties. common.loader= ${catalina.home}/common/classes,\ ...\ ${catalina.home}/common/lib/ext/*.jar


7. Make sure your database server is installed and is working.
If it's installed in a different machine make sure that it's accessible from the one where Liferay is being installed.


8. Configure data sources for your database. Make sure the JDBC driver for your database is accessible by Tomcat.
8.1. Obtain the JDBC driver for your version of the database server. In the case of MySQL use mysql-connector-java-{$version}-bin.jar.
8.2. Copy the JAR file to $TOMCAT_HOME/lib/ext

9. Create a database for Liferay.
For example: create database lportal character set utf8; Liferay will automatically create the tables and populate it the first time it starts.

10. To add support for accessing Liferay's services remotely and to access the document library using WebDAV follow these steps:
10.1. Download tunnel-web.war
10.2. Create a directory called $TOMCAT_HOME/webapps/tunnel and unzip the WAR contents inside

11. Create $TOMCAT_HOME/conf/jaas.config.

PortalRealm { com.liferay.portal.kernel.security.jaas.PortalLoginModule required; };


12. Edit $TOMCAT_HOME/bin/catalina.bat so that Tomcat can reference the login module.
set JAVA_OPTS=-Xms128m -Xmx512m -Dfile.encoding=UTF8 -Duser.timezone=GMT -Djava.security.auth.login.config=%CATALINA_HOME%/conf/jaas.config

13. Delete contents $TOMCAT_HOME/webapps/ROOT directory.


14. Unpack liferay-portal-5.2.3.war to $TOMCAT_HOME/webapps/ROOT.


15. For supporting UTF-8 UIRIEncoding, edit $TOMCAT_HOME/conf/server.xml.


16. Run Tomcat, point browser to http://localhost:8080. Sign in as test@liferay.com and password test


NOTE: ---- ************copy the following jar files in lib/ext folder to avoid startup problem:********
activation.jar annotations.jar ccpp.jar container.jar hsql.jar jms.jar jta.jar jutf7.jar mail.jar mysql.jar portal-kernel.jar
portal-service.jar portlet-container.jar portlet.jar postgresql.jar serializer.jar support-tomcat.jar xalan.jar xercesImpl.jar

xml-apis.jar

5 comments :

Nagendra Kumar Busam said...

Hi Arun,

Thank you very much for the gr8 post.

I was trying to setup liferay on tc server (tomcat) according to client req's.

Can you recheck points 5 & 6 in this post. Since i didn't find any folder like common under tomcat-home of my installation where as in "common.loader" property you are referring to it.



Thanks,
- Nagendra Kumar

Arun said...

create ext folder under tomcat6.0/lib

and paste the dependencies jar files

you can find common.loader property under tomcat6.0/conf/catalina.properties

sasikala said...

hii arun...

thanks u for ur post
i followed all the steps in ur post
still am getting the startup problem... can u pls help me..

D:\apps\Apache\tomcat\bin>startup.bat
Using CATALINA_BASE: D:\apps\Apache\tomcat
Using CATALINA_HOME: D:\apps\Apache\tomcat
Using CATALINA_TMPDIR: D:\apps\Apache\tomcat\temp
Using JRE_HOME: D:\apps\java\jdk
Using CLASSPATH: D:\apps\Apache\tomcat\bin\bootstrap.jar
'timezone' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.


thanks,

-Sasikala

Sara Gozalo said...

I have som problems when I try to deploy a portlet in this system....The portlet doesn't appear en "Add application" even if I deploy with liferay autodeploy......any suggestion?

Thanks!!!

Siva Rama Krishna said...

Hi Guys,
I'm trying to setup liferay portal tomcat instance on the tcServer but end up with startup errors.

Error:
22-Dec-2010 21:42:31.510 INFO org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor ROOT.xml
22-Dec-2010 21:42:36.260 SEVERE org.apache.catalina.core.StandardContext.start Error listenerStart
22-Dec-2010 21:42:36.260 SEVERE org.apache.catalina.core.StandardContext.start Context [] startup failed due to previous errors