User Guide - Liferay Portal using Tomcat


Applicable Plans: All Advanced VPS, all Premier VPS (CentOS 5 plans)

Liferay Portal is a JSR-168/JSR-286 compliant portal.The Liferay Bundle is Liferay Portal pre-deployed and pre-configured on an application server.Liferay Tomcat 6 bundle include Apache Tomcat version 6 which implements the Servlet 2.5 and JavaServer Pages 2.1 specifications. This provides the steps necessary to use the Liferay Tomcat 6 bundle with a MySQL database server in your VPS.

This document explains how to deploy Liferay using Tomcat with MySQL and PostgreSQL. It also explains how to use Apache as a front end to Liferay which is required if you want to use any application services that are dependent on Apache.

Requirements

Please note the following:

Liferay Portal is only available on plans running CentOS 5 operating system and higher. If your plan is running an older operating system, please contact billing@eapps.com for information on how to move to a newer version of your plan.

Liferay is bundled with either Tomcat or GlassFish. This user guide is for the Tomcat bundle. Please see the Liferay Portal with GlassFish User Guide if you want to use GlassFish.

When using Liferay Portal, you will not be able to install the stand alone versions of Tomcat, GlassFish or JBoss.

You will need to install Liferay-Tomcat-6 and either MySQL or PostgreSQL database server. You will also need to install Java 5 or Java 6 for the Tomcat server to successfully start. These can be installed from your Control Panel > System tab > Add Application area.

 

Using Liferay Tomcat Bundle with MySQL (use theinstructions in this section if you want to use MySQL. PostgreSQL users should skip to the next section)

Installing Liferay, MySQL and Java

  1. Log into your control panel.

  2. From the System tab click Add Application.

  3. Select the check box next to Liferay-Tomcat-6, MySQL-5 and Java-SE-5 or Java-SE-6.

  4. Click the Next button on the bottom right.

 

It will take about 5 to 10 minutes for the installation to fully complete. You can confirm installation by checking the list of installed applications from your System tab -> All Applications area. Since the installation is a bundled Tomcat 6, the files will be located in /opt/tomcat6/webapps/ROOT of your VPS. After the applications are successfully installed take the steps below to enable MySQL support.

 

From your control panel System tab Database Management area click Databases.

Click Add Database.

In the Database Name field type lportal and click save.

Type your desired database username and password in the field and click save.

Click the Database Content tab at the top of the next window.

Click Upload MySQL Dump File.

Make sure “File inside Container” is selected and add /opt/tomcat6/create-mysql-liferay.sql in the field.

Click Ok to upload the SQL data.

Click System tab then File Manager.

(Liferay 5.1.1 users can skip this step and continue from step 11). Navigate to opt -> tomcat6 -> webapps -> ROOT -> WEB-INF -> classes. Select the check box next to portal-ext.properties and click edit. Uncomment the lines in the MySQL or PostgreSQL section, make sure Unix(LF) is selected and click ok to save the file. Continue from step 21 to complete the setup.

Navigate to opt -> tomcat6 -> conf -> Catalina -> localhost.

Select the check box next to ROOT.xml and click Edit.

Locate the <!-- Hypersonic --> and <!-- MySQL --> resource sections and modify them to look like below.

 

<!-- Hypersonic -->


 

<!--<Resource

name="jdbc/LiferayPool"

auth="Container"

type="javax.sql.DataSource"

driverClassName="org.hsqldb.jdbcDriver"

url="jdbc:hsqldb:lportal"

username="sa"

password=""

maxActive="20"

/>-->


 

<!-- MySQL -->


 

<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&amp;useFastDateParsing=false"

username="username"

password="password"

maxActive="20"

/>

Note: username and password above are the values you assigned in step 4.

 

  1. Make sure Unix(LF) is selected and click Ok to save the file.

  2. Click System tab -> Liferay-Tomcat-6 -> Restart to start the service. Initial startup will take about 10 minutes because of database setup and JSP compilation.

 

You can now use your Liferay installation at http://yourdomain.com:8080 . The user and password is in you control panel -> System tab -> Liferay-Tomcat-6 area. For information on removing the 8080 from the URL by using Apache as a front end, and to enable the use of Apache in general, please see the section Using mod_jk and mod_proxy_ajp.

 

Using Liferay Tomcat Bundle with PostgreSQL (use the instructions in this section if you want to use PostgreSQL. MySQL users should use instructions in the previous section)

 

*** coming soon ***

 

Using mod_jk and mod_proxy_ajp

 

You can use your Apache Web Server as a front end to Tomcat to eliminate the need to the 8080 in the URL above. To do this you can either use mod_jk or mod_proxy_ajp.

 

To use mod_jk first install mod_jk from your control panel system tab -> Add Application area.

  1. Click Site tab.

  2. If the site you want to configure is not selected click Select Another Site and select it.

  3. Click Website Settings.

  4. Click the Custom Settings tab -> Edit and add the lines below.

 

JkMount /* ajp13


 

# Directives to enable Apache to continue serving applications dependent on it.

SetEnvIf Request_URI "/webmail*" no-jk

SetEnvIf Request_URI "/mail*" no-jk

SetEnvIf Request_URI "/awstats*" no-jk

SetEnvIf Request_URI "/myadmin*" no-jk

SetEnvIf Request_URI "/pgadmin*" no-jk

SetEnvIf Request_URI "/cgi-bin*" no-jk

SetEnvIf Request_URI "/openwebmail*" no-jk

 

  1. Click Update the save the configuration.

 

To use mod_proxy_ajp, complete steps 1 to 3 above. Click the Custom Settings tab -> Edit and add the lines below.

 

 

# Directives for eApps applications dependent on Apache

ProxyPass /webmail !

ProxyPass /mail !

ProxyPass /awstats !

ProxyPass /myadmin !

ProxyPass /cgi-bin !

ProxyPass /pgadmin !

ProxyPass /openwebmail !


 

# Directives for your application

ProxyPass / ajp://localhost:8009/

ProxyPassReverse / ajp://localhost:8009/

 

Links to Other Information

 

Liferay Documentation - http://www.liferay.com/web/guest/community/documentation/5_1


Comments

Please login to comment