This article describes how to set up Liferay Portal 6.1 EE or Liferay Portal 6.2 EE using Windows and MySQL 5.x on Apache Tomcat 7.x.
Resolution
1. Gather the Necessary Files
- Download and unzip the most recent supported version of Tomcat 7: http://archive.apache.org/dist/tomcat/tomcat-7/
- The unzipped local folder where Apache Tomcat is located will be abbreviated:
${TOMCAT_HOME}. - Download the most recent Liferay.war file and Liferay Portal source files and dependencies. Liferay WAR and dependencies.
2. Dependency Jars
- Create a folder called
extinside{$TOMCAT_HOME}/lib/. - If there is also a downloaded Tomcat bundle, administrators also have the option copy all the files from that bundle's
{$TOMCAT_HOME}/lib/extfolder and place them in this current Tomcat server's{$TOMCAT_HOME}/lib/extfolder. After that, skip to step 5. - However, if developers are building Liferay and using that for the dependencies, extract the dependencies files to
{$TOMCAT_HOME}/lib/ext - Copy the following jars from the
liferay-portal-src-6.x-ee-spXX/lib/developmentto$TOMCAT_HOME/lib/extfolder. (These can also be taken from an existing bundle.):activation.jarjms.jarjta.jarjutf7.jarmail.jarpersistence.jarresin.jarscript-10.jar
- Copy the ccpp.jar from
liferay-portal-src-6.x-ee-spXX/lib/portalto the{$TOMCAT_HOME}/lib/extfolder. - If using MySQL, download the latest MySQL JDBC driver http://www.mysql.com/products/connector/ and place
mysql-connector-java-{$version}-bin.jarto the{$TOMCAT_HOME}/lib/extfolder.
3. Configure the Domain
-
Create
setenv.bat|shin${TOMCAT_HOME}/bin - For Windows users, edit
setenv.batwith 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"
- Create the folder
Catalinainside{$TOMCAT_HOME}/conf/. - Create the folder
localhostinside{$TOMCAT_HOME}/conf/Catalina. - Create the file
ROOT.xmlin{%TOMCAT_HOME}/conf/Catalina/localhost. - Edit
ROOT.mxlwith 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> - Edit
{$TOMCAT_HOME}/conf/catalina.propertiesand 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 - Edit
{$TOMCAT_HOME}/conf/server.xmland replace
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
with
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" /> - Navigate to
{$TOMCAT_HOME}/webappsand delete support-catalina.jar if it exists.
4. Deploy Liferay
- Navigate to
{$TOMCAT_HOME}/webapps/and delete the contents including theROOT. - Create a new
ROOTfolder. - Extract the contents of
liferay-portal-6.x.x.warto{$TOMCAT_HOME}/webapps/ROOT - Open a command console to
{$TOMCAT_HOME}/binand start the application server.