Install Liferay Portal 6.2 on Tomcat 8.5 for Windows

This article describes how to set up Liferay Portal 6.2 on Tomcat 8.5 server using Windows.

Resolution

 1. ) Download Necessary Files:

  • Liferay-portal-6.2-ee-sp20-20170717160924965.war
  • Liferay-portal-dependencies-6.2-ee-sp20
  • liferay-portal-6.2-ee-sp20(with Tomcat 7.0.62 as default server in bundle)
  • tomcat-8.5.45

Files can be found at the Help Center Downloads Page.

2. ) Setup Dependency Jars:

  1. Create a folder in Tomcat 8.5 named ext in %CATALINA_HOME%/lib
  2. Unzip the Liferay Dependencies and copy the .jar files to %CATALINA_HOME%/lib/ext in Tomcat 8.5
  3. Download the support-tomcat.jar file from HERE and copy it into %CATALINA_HOME%/lib/ext directory in Tomcat 8.5
  4. Download a few third party .jar files and place these .jar files into %CATALINA_HOME%/lib/ext:
  • jta.jar
  • mail.jar
  • persistence.jar
  • activation.jar
  • ccpp.jar
  • jms.jar
  • jutf7.jar
  • junit.jar

Note: Because the links to download these .jar files are out of date, use the .jar file in Portal 6.2.: liferay-portal-6.2-ee-sp20\tomcat-7.0.62\lib\ext

3. ) Tomcat configuration:

  1. Create a setenv.bat (Windows) in the %CATALINA_HOME%/bin directory in Tomcat 8.5. Populate it with the following contents:
  • 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 "CATALINA_OPTS=%CATALINA_OPTS% -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=GMT -Xmx1024m -XX:MaxPermSize=256m"
    
  • Create the directory %CATALINA_HOME%/conf/Catalina/localhost in Tomcat 8.5
  • Create ROOT.xml in  %CATALINA_HOME%/conf/Catalina/localhost
  • Edit ROOT.xml and add the following:
    • <Context path="" crossContext="true">

      <!-- JAAS -->

      <!--<Realm
      classNjame="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>
  • Open %CATALINA_HOME%/conf/catalina.properties and replace the line:
    •  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
  • Edit %CATALINA_HOME%/conf/server.xml and add the attribute URIEncoding="UTF-8" where you see redirectPort=8443, in the definition of your connectors (HTTP and AJP) as below:
    • <Connector port="8080" protocol="HTTP/1.1"
      connectionTimeout="20000"
      redirectPort="8443" URIEncoding="UTF-8"/>

      <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8"/>
  • Lastly, if you see a support-catalina.jar in your %CATALINA_HOME%/webapps directory, delete it.
  • 4. ) Deploy Liferay

    1. Delete the contents of %CATALINA_HOME%/webapps/ROOT. Extract the Liferay .war file to %CATALINA_HOME%/webapps/ROOT
    2. Start Tomcat by executing %CATALINA_HOME%/bin/startup.bat

    Result: Liferay Portal 6.2 can be installed on Tomcat 8.5 and the portal can be started successfully.

    这篇文章有帮助吗?
    1 人中有 1 人觉得有帮助