In my previous blog, I shared how to install liferay on existing tomcat using liferay source code. You can found my previous blog here http://helicaltech.com/install-liferay-existing-tomcat-7/
This blog will be talking about how to install liferay on Tomcat using WAR (existing Tomcat)
For this Section, I will refer to your tomcat’s installation folder as $TOMCAT_HOME. Before you begin, make sure that you have downloaded Liferay latest war file. If you haven’t downloaded, you can download from http://www.liferay.com/downloads/liferay-portal/additional-files (Find “Download Wars” section And portal dependencies files from “Dependencies” section).
After downloading, you will get a liferay-portal-6.1.x-<date>.war and
If you have liferay in your machine, you don’t need to download
liferay-portal-dependencies. You can use same Liferay global library as your portal-dependencies files.
Follow these steps, to install Liferay war in Tomcat:
Create folder $TOMCAT_HOME/lib/ext.
Extract the Liferay dependencies file to $TOMCAT_HOME/lib/ext.
The best way to get the appropriate versions of these files is, If you have liferay in your machine, then copy all .jar from $LIFERAY_HOME/lib/ext to $TOMCAT_HOME/lib/ext (If you are going through this step, ignore Step-3 and Step-4)
Download the Liferay source code and get them from there. Once you have downloaded the Liferay source, unzip the source into a temporary folder and Copy the following jars from $LIFERAY_SOURCE/lib/development to $TOMCAT_HOME/lib/ext
Make sure the JDBC driver for your database is accessible by Tomcat. Copy JDBC driver for your version of the database server to $TOMCAT_HOME/lib/ext.
Liferay requires an additional jar to manage transactions. You may find this .jar here: http://www.oracle.com/technetwork/java/javaee/jta/index.html.
Now, Edit $TOMCAT_HOME/conf/catalina.properties file. Change this line
Create setenv.bat in $TOMCAT_HOME/bin folder and add these lines:
if exist “%CATALINA_HOME%/[email protected]@/win” (
set “JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=GMT -Xmx1024m -XX:MaxPermSize=256m”
I am deploying liferay in $TOMCAT_HOME/webapps/ROOT folder. So we need to Create the directory
$TOMCAT_HOME/conf/Catalina/localhost and create a
ROOT.xml file in it. Edit this file and populate it with the following contents to set up a portal web application:
<Context path="" crossContext="true">
Now, Deploy Liferay.
If you are manually installing Liferay on a clean Tomcat server, delete the contents of the
$TOMCAT_HOME/webapps/ROOT directory. This undeploys the default Tomcat home page. Then extract the liferay-portal-6.1.x-<date>.war file to
Start Tomcat by executing $TOMCAT_HOME/bin/startup.sh
Congratulations on successfully installing and deploying Liferay on Tomcat!
For any confusion, please get in touch with us at Helical IT Solutions