User Guide - Liferay Portal using GlassFish


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 GlassFish bundle includes GlassFish version 2 with Liferay pre-deployed and pre-configured.

 

This document explains how to deploy Liferay using GlassFish 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 GlassFish bundle. Please see the Liferay Portal with Tomcat User Guide if you want to use Tomcat.

 

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-GlassFish, MySQL and MySQL-Connector-J. You will also need to install Java 5 or Java 6 for the GlassFish server to successfully start. These can be installed from your control panel Add Application area.

 

Using Liferay GlassFish Bundle with MySQL (use the instructions 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-GlassFish, MySQL-5, MySQL-Connector-J 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 by checking the list of installed applications from your Control Panel -> System tab -> All Applications area. Since the installation is a bundled GlassFish, the files will be located in /opt/glassfish/domains/domain1/applications/j2ee-modules/liferay-portal of your VPS. You will also need the default GlassFish admin password which can be found in your control panel -> System tab -> GlassFish area. 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.

Now log into you GlassFish admin console at yourdomain.com:4848

From the Common Task menu expand Resources.

Expand JDBC under resources.

Click on Connection Pools and the Connection Pools page will be displayed.

Click on New.

Enter a name for the pool (eg LiferayMySQL).

Select javax.sql.ConnectionPoolDataSource as the Resource Type.

Select Mysql as the Database Vendor.

Click Next

Enter the details to fit your needs. Minimum you need are the following.

  1. DatabaseName – this will be the name of the database you created in step 3 (lportal)

  2. Password – this is the password you set for the user you created.

  3. URL – it should be jdbc:mysql://localhost:3306/lportal

  4. UrI - it should be jdbc:mysql://localhost:3306/lportal

  5. ServerName – localhost

  6. User – the user you created in step 4.

Click Finish.

Click on the connection pool you just created.

Click ping. If the connection pool is setup correctly you will get a Ping Succeeded message.

From the Resources menu click on JDBC then JDBC Resources.

Click New. (Liferay 5.1.1 users will already have a jdbc/LiferayPool resource. If you are using 5.1.1 click on the already available jdbc/LiferayPool resource and continue from step 21.

In the JNDI Name Field add jdbc/LiferayPool resource. (the resource must have this name or database connectivity will fail).

From the Pool Name drop down select the pool you just created in steps 5 to 14 (eg LiferayMySQL).

Click Ok to save the changes.

Modify your portal-ext.properties file and enable access to your LiferayPool (Liferay 5.1.1 users can skip this step and continue from step 24). Log into your control panel, from the System tab click File Manager. Navigate to opt -> glassfish -> domains -> domain1 -> config. Select the check box next to portal-ext.properties and click edit. Uncomment the #jdbc.default.jndi.name=jdbc/LiferayPool line. Make sure Unix(LF) is selected and click ok to save the file.

From the System tab of your control panel click the GlassFish icon.

Click "Stop" and then "Start" to restart GlassFish. Initial startup will take about 10 minutes because of database setup and JSP compilation.

You can view your Liferay front page at http://yourdomain.com:8080. The default user and password can be found in your control panel -> System tab -> GlassFish 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 GlassFish Bundle with PostgreSQL (use the instructions in this section if you want to use PostgreSQL. MySQL users should use instructions in the previous section)

 

Installing Liferay, PostgreSQL and Java, phpPgAdmin and PostgreSQL-JDBC-Driver

  1. Log into your control panel.

  2. From the System tab click Add Application.

  3. Select the check box next to Liferay-GlassFish, PostgreSQL-8, PostgreSQL-JDBC-Driver 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 by checking the list of installed applications from your Control Panel -> System tab -> All Applications area. Since the installation is a bundled GlassFish, the files will be located in /opt/glassfish/domains/domain1/applications/j2ee-modules/liferay-portal of your VPS. You will also need the username and password for GlassFish and phpPgAdmin. These can be found in your Control Panel -> System tab -> GlassFish area for GlassFish and System tab -> phpPgAdmin for phpPgAdmin. After the applications are successfully installed take the steps below to enable PostgreSQL support.

 

Log into phppgadmin.

Click Databases then Create database

In the Name field type lportal.

Select UTF8 as the Encoding and Click Create.

Click Roles then Create role.

In the Name and Password fields fill in your desired username and password.

Select the Check box for Create BD? and Can login?.

Click Create.

Now log into you GlassFish admin console at yourdomain.com:4848

From the Common Task menu expand Resources.

Expand JDBC under resources.

Click on Connection Pools and the Connection Pools page will be displayed.

Click on New.

Enter a name for the pool (eg LiferayPostgreSQL).

Select javax.sql.ConnectionPoolDataSource as the Resource Type.

Select PostgreSQL as the Database Vendor.

Click Next

Enter the details to fit your needs. Minimum you need are the following.

  1. DatabaseName – this will be the name of the database you created in step 3 (lportal)

  2. Password – this is the password you set in step 6.

  3. PortNumber – 5432

  4. User – the user you created in step 6

Click Finish.

Click on the connection pool you just created.

Click ping. If the connection pool is setup correctly you will get a Ping Succeeded message.

From the Resources menu click on JDBC then JDBC Resources.

Click New. (Liferay 5.1.1 users will already have a jdbc/LiferayPool resource. If you are using 5.1.1 click on the already available jdbc/LiferayPool resource and continue from step 25.

In the JNDI Name Field add jdbc/LiferayPool resource. (the resource must have this name or database connectivity will fail).

From the Pool Name drop down select the pool you just created in steps 11 to 19 (eg LiferayPostgreSQL).

Click Ok to save the changes.

Modify your portal-ext.properties file and enable access to your LiferayPool (Liferay 5.1.1 users can skip this step and continue from step 28). Log into your control panel, from the System tab click File Manager. Navigate to opt -> glassfish -> domains -> domain1 -> config. Select the check box next to portal-ext.properties and click edit. Uncomment the #jdbc.default.jndi.name=jdbc/LiferayPool line. Make sure Unix(LF) is selected and click ok to save the file.

From your control panel System tab click the GlassFish icon.

Click Restart to restart GlassFish. Initial startup will take about 10 minutes because of database setup and JSP compilation.

You can view your Liferay front page at http://yourdomain.com:8080. The default user and password can be found in your control panel -> System tab -> GlassFish area.

 

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