5. Tomcat 5.5.17

  1. Download and install Tomcat 5.5.17 into your preferred directory. From now on, the directory where you installed Tomcat will be referred to as $TOMCAT_HOME.

  2. Download and install JDK 5 . Set an environment variable called %JAVA_HOME% to point to your JDK directory.

    Note: If you are using JDK 1.4, you must download and install the JDK 1.4 Compatability Package at tomcat.apache. For JDK 1.4 users: delete $TOMCAT_HOME/webapps/ROOT/WEB-INF/lib/xercesImpl.jar. For JDK 5 users: move $TOMCAT_HOME/webapps/ROOT/WEB-INF/lib/xercesImpl.jar to TOMCAT_HOME/common/endorsed.

  3. Download MySQL from www.mysql.com and install.

  4. Create and edit $TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml to set up the portal web application.

    <Context path="">
    </Context>
  5. Download liferay-portal-pro-4.x.war.

  6. Download portlet.jar and portal-kernel.jar from liferay Portal 4.x Dependencies.

    1. Create a $TOMCAT_HOME/common/lib/ext directory and copy these two files there. If the files do not extract to this directory, make sure they are in the correct directory by moving them there.

  7. Edit $TOMCAT_HOME/conf/catalina.properties.

    common.loader=
        ${catalina.home}/common/classes,\
        ...\
        ${catalina.home}/common/lib/ext/*.jar
  8. Configure data sources for your database. Make sure the JDBC driver for your database is accessible by Tomcat.

    1. Download mysql-connector-java-{$version}-bin.jar. (This is the JDBC connector for MySQL, for other databases, go to appropriate website to download.)

    2. Copy to $TOMCAT_HOME/common/lib/ext.

  9. Edit $TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml.

    <Context...>
        <Resource
            name="jdbc/LiferayPool"
            auth="Container"
            type="javax.sql.DataSource"
            driverClassName="com.mysql.jdbc.Driver"
            url="jdbc:mysql://localhost/lportal?useUnicode=true&amp;characterEncoding=UTF-8"
            username=""
            password=""
            maxActive="100"
            maxIdle="30"
            maxWait="10000"
        />
    </Context>
  10. Populate your database with the portal schema and default data.

    1. Download script create-mysql.sql from Liferay Portal 4.x SQL Scripts.

    2. In command prompt, run mysql script by entering mysql < create-mysql.sql

  11. Create a mail session bound to mail/MailSession.

    Edit $TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml and configure a mail session.

    <Context...>
    	<Resource
    		name="mail/MailSession"
    		auth="Container"
    		type="javax.mail.Session"
    		mail.transport.protocol="smtp"
    		mail.smtp.host="localhost"
    	/>
    </Context>
    
  12. Configure JAAS.

    Edit $TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml and configure a security realm.

    <Context...>
    	<Realm 
    		className="org.apache.catalina.realm.JAASRealm"
    		appName="PortalRealm"
    		userClassNames="com.liferay.portal.security.jaas.PortalPrincipal"
    		roleClassNames="com.liferay.portal.security.jaas.PortalRole"
    		debug="99"
    		useContextClassLoader="false"
    	/>
    </Context>
  13. Repeat this step for a file called $TOMCAT_HOME/conf/Catalina/localhost/tunnel.xml if you want to enable Liferay's HTTP tunneling.

  14. Create $TOMCAT_HOME/conf/jaas.config.

    PortalRealm {
    	com.liferay.portal.kernel.security.jaas.PortalLoginModule required;
    };
    
    
  15. Edit $TOMCAT_HOME/bin/catalina.bat so that Tomcat can reference the login module.

    rem ----- Execute...
    
    set JAVA_OPTS=-Xms128m -Xmx512m -Dfile.encoding=UTF8 -Duser.timezone=GMT -Djava.security.auth.login.config=%CATALINA_HOME%/conf/jaas.config
  16. Delete contents $TOMCAT_HOME/webapps/ROOT directory.

  17. Unpack liferay-portal-pro-4.x.war to $TOMCAT_HOME/webapps/ROOT.

  18. For supporting UTF-8 UIRIEncoding, edit $TOMCAT_HOME/conf/server.xml.

    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
       <Connector port="8080" maxHttpHeaderSize="8192"
                   maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                   enableLookups="false" redirectPort="8443" acceptCount="100"
                   connectionTimeout="20000" disableUploadTimeout="true"
                   URIEncoding="UTF-8"
       />
  19. Run Tomcat, point browser to http://localhost:8080. Sign in as test@liferay.com and password test