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
ext
inside{$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/ext
folder and place them in this current Tomcat server's{$TOMCAT_HOME}/lib/ext
folder. 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/development
to$TOMCAT_HOME/lib/ext
folder. (These can also be taken from an existing bundle.):activation.jar
jms.jar
jta.jar
jutf7.jar
mail.jar
persistence.jar
resin.jar
script-10.jar
- Copy the ccpp.jar from
liferay-portal-src-6.x-ee-spXX/lib/portal
to the{$TOMCAT_HOME}/lib/ext
folder. - If using MySQL, download the latest MySQL JDBC driver http://www.mysql.com/products/connector/ and place
mysql-connector-java-{$version}-bin.jar
to the{$TOMCAT_HOME}/lib/ext
folder.
3. Configure the Domain
-
Create
setenv.bat|sh
in${TOMCAT_HOME}/bin
- For Windows users, edit
setenv.bat
with 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
Catalina
inside{$TOMCAT_HOME}/conf/
. - Create the folder
localhost
inside{$TOMCAT_HOME}/conf/Catalina
. - Create the file
ROOT.xml
in{%TOMCAT_HOME}/conf/Catalina/localhost
. - Edit
ROOT.mxl
with 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.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
- Edit
{$TOMCAT_HOME}/conf/server.xml
and 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}/webapps
and delete support-catalina.jar if it exists.
4. Deploy Liferay
- Navigate to
{$TOMCAT_HOME}/webapps/
and delete the contents including theROOT
. - Create a new
ROOT
folder. - Extract the contents of
liferay-portal-6.x.x.war
to{$TOMCAT_HOME}/webapps/ROOT
- Open a command console to
{$TOMCAT_HOME}/bin
and start the application server.