Legacy Knowledge Base
Published Jul. 2, 2025

Setting Up Liferay Portal War on Tomcat 7

Written By

Justin Choi

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

This article documents how to set up Liferay Portal using a war on Tomcat 7.

Resolution

1. Gather the Necessary Files

  1. Download and unzip the most recent supported version of Tomcat 7.
  2. Download the most recent Liferay WAR, source code, and dependencies.

2. Dependency Jars

  1. Create a folder called ext in {$TOMCAT_HOME}/lib/ext.
  2. Extract the dependencies files to {$TOMCAT_HOME}/lib/ext.
  3. Copy the following jars from {$build}/lib/development to $TOMCAT_HOME/lib/ext:
    • activation.jar
    • jms.jar
    • jta.jar
    • jutf7.jar
    • mail.jar
    • persistence.jar
  4. Copy the ccpp.jar from {$build}/lib/portal to {$TOMCAT_HOME}/lib/ext.
  5. Copy the followings jars from {$build}/lib/development to {$TOMCAT_HOME}/lib/ext:
    • resin.jar
    • script-10.jar
  6. Download the latest MySQL JDBC driver from the MySQL Connectors page and extract mysql-connector-java-{$version}-bin.jar to {$TOMCAT_HOME}/lib/ext.

3. Configure the Domain

  1. Create the file setenv.bat in $TOMCAT_HOME}/bin.
  2. Edit the setenv.bat file and add the following:
    if exist "%CATALINA_HOME%/jre@java.version@/win" (
       if not "%JAVA_HOME%" == "" (
       set JAVA_HOME=
       )
       set "JRE_HOME=%CATALINA_HOME%/jre@java.version@/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"
    
    
  3. Navigate to the folder {$TOMCAT_HOME}/conf/Catalina/ and create a folder called localhost. If those folders do not exist, then create them.
  4. Create the file ROOT.xml in {%TOMCAT_HOME}/conf/Catalina/localhost.
  5. Edit the ROOT.xml and add the following:
    <Context path="" crossContext="true">
    <!-- JAAS -->
    
    <!--<Realm
       className="org.apache.catalina.realm.JAASRealm"
       appName="PortalRealm"
       userClassNames="com.liferay.portal.kernel.security.jaas.PortalPrincipal"
       roleClassNames="com.liferay.portal.kernel.security.jaas.PortalRole"
     />-->
    
    <!-- Uncomment the following to disable persistent sessions across reboots. -->
    
    <!-- <Manager pathname="" /> -->
    
    <!--
       Uncomment the following to not use sessions. See the property
       "session.disabled" in portal.properties.
     -->
    
    <!-- <Manager className="com.liferay.support.tomcat.session.SessionLessManagerBase" /> -->
     </Context>
    
  6. Edit {$TOMCAT_HOME}/conf/catalina.properties and replace
    common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar
    with
    common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/lib/ext,${catalina.home}/lib/ext/*.jar
  7. Edit  {$TOMCAT_HOME}/conf/server.xml and replace
    <connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" />
    with
    <connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" URIEncoding="UTF-8" />
  8. Navigate to {$TOMCAT_HOME}/webapps and delete support-catalina.jar if it exists.

4. Deploy the Liferay Portal war

  1. Navigate to the folder {$TOMCAT_HOME}/webapps/ROOT and delete the contents.
  2. Extract the contents of the portal .war to {$TOMCAT_HOME}/webapps/ROOT.
  3. Open a command console to {$TOMCAT_HOME}/bin and enter the command startup.bat|sh to start the server.
Did this article resolve your issue ?

Legacy Knowledge Base