User Guide - Liferay Portal using Glassfish


Applicable Plans - Virtual Server in Cloud using ISPmanager (ISPsystem)

User Guide - Liferay Portal using Glassfish

Overview

Note This User Guide is written specifically for the CentOS 6 64bit Liferay-GlassFish (ISPmanager CP) template. This template comes with all the individual components for Liferay-GlassFish using MySQL already configured.

If you only need to install GlassFish, you can either install the CentOS 6 64bit GlassFish (ISPmanager CP) template when you create your Virtual Server, or you can install GlassFish manually from ISPmanager after the Virtual Server has been created.

If you have installed the wrong template by mistake, please contact eApps Support for assistance.

You will also need to make sure that you have enough memory available for Liferay-GlassFish. For a small Liferay deployment, start with 1536 MB (1.5 GB) of RAM, and be prepared to scale upwards as necessary.

eApps support for Liferay-GlassFish is limited to the installation of the application. Liferay is an enterprise application aimed at large corporations and organizations who have in-house or contract Java developers.

While it is simple to install Liferay-GlassFish using the pre-configured eApps template, you will still need to have expert-level Java development and deployment skills in order to customize Liferay-GlassFish to your specific needs. Due to the complexity of the Liferay application, it is impossible to provide support for any portlets or for any type of Liferay customization.

If you need assistance using Liferay, you will need to consult the Liferay documentation, or one of the books available that cover Liferay in more depth. The Liferay Community Resources page has links to wikis, books and tutorials to help you get started.

It is possible to install all the components for Liferay-GlassFish separately, but you will need to manually configure Liferay, GlassFish, and your database in order to have a working system. Please see the official Liferay documentation for more information - http://www.liferay.com/documentation/liferay-portal/6.0/getting-started.

Prerequisites

GlassFish and MySQL Configuration options
Changing the GlassFish Admin Console password
Restarting GlassFish
Changing the MySQL password

Liferay Portal Configuration
Creating the Liferay Admin User and Password
Using mod-jk or mod-proxy to bypass Apache


Prerequisites

You will need a Virtual Server created using the CentOS 6 64bit Liferay-GlassFish (ISPmanager CP) template. If you wish to use mod_jk to pass requests from Apache to Liferay, you will need to install it also. If you are going to use mod_proxy_ajp to pass requests from Apache to Liferay, nothing needs to be installed because that is part of the default Apache install.

To install applications using ISPmanager, navigate to Server Settings > Applications. This screen lists both the installed and available applications.

Click on the application you want to install to highlight it, and then click on Install in the upper right corner of the screen.

Once the applications are installed, they will be listed in the Installed version column.

If you are going to use either the mod_jk or mod_proxy_ajp approach, you will also need to create a virtual host in Apache. See the User Guide: Creating Websites using ISPmanager - http://support.eapps.com/ispmgr/website-create for more information.

If you need to do any customization to Liferay-Glassfish, you will need root access to the Virtual Server via the command line. See the User Guide: Connecting to your Virtual Server (SSH and MindTerm) - http://support.eapps.com/ispmgr/ssh


GlassFish and MySQL Configuration options

The CentOS 6 64bit Liferay-GlassFish (ISPmanager CP) template installs all the components needed to run the Liferay-GlassFish portal, including the MySQL database and database user and password. However, you will want to change the GlassFish Admin Console password and the MySQL password to help ensure the security of your application. You will also need to restart GlassFish so that the final configuration of the Liferay portal completes.

Changing the GlassFish Admin Console password

The GlassFish Admin Console is where you manage the GlassFish server. To access the Admin Console, go to http://eapps-example.com:4848 (substitute your domain name for eapps-example.com). It make take a few minutes for the GlassFish Admin Console to fully load.

The default User Name and Password for the Glassfish Admin Console are found in the Application name for Liferay Portal Glassfish, which is located in ISPmanager: Server Settings > Applications. Log in to the GlassFish Admin Console with this information.

GlassFish Admin Console


Once you are logged in to the GlassFish Admin Console, click on Enterprise Server in the Common Tasks left navigation pane.

Enterprise Server


Click on the Administrator Password tab, and in the New Administrator Password screen, enter the new password for the GlassFish Admin Console. Click on Save to save the new password.

New Admin Password

Restarting GlassFish

GlassFish has to be restarted so that the final configuration for Liferay Portal can complete.

To restart GlassFish, click on the General tab (just to the left of the Administrator Password) tab. Click on Restart to restart the GlassFish server.

GlassFish restart

Be aware that it may take the GlassFish server up to five minutes to restart, possibly longer. Please be patient.

Changing the MySQL password

The CentOS 6 64bit Liferay-GlassFish (ISPmanager CP) template contains a pre-configured MySQL database for Liferay-GlassFish. This database is part of the default Liferay-GlassFish install, and has the required tables and data needed to run the Liferay Portal.

The MySQL database is set up with a default database name, user and password. The database name (lportal) is required by Liferay, and cannot be changed. eApps recommends that you change the MySQL password for better security.

To access the MySQL password, navigate to LiferayMySQL in the Common Tasks menu in the left navigation pane: Common Tasks > Resources > JDBC > Connection Pools > LiferayMySQL

LiferayMySQL Connection Pool


Click on the Additional Properties tab, and find the value for Password in the list (you will need to scroll down a bit).

Additional Properties

This is the MySQL database password. Change this password to your desired password, and then scroll back up to the top of the screen and click Save.

Remember - leave the name of the database and the database user at their preconfigured settings.


Liferay Portal Configuration

Once you have changed the GlassFish Admin Console password, restarted GlassFish, and also changed the MySQL database password, you can now access the Liferay Portal, at http://eapps-example.com:8080 (substitute your domain name for eapps-example.com). This is the default Liferay Portal screen, which has explanations of the various features of Liferay.

You will need to create a new Liferay Admin user, and depending on your configuration, you can also set up mod_jk to remove the :8080 from the URL for the Liferay Portal.

Creating the Liferay Admin User and Password

There is a default Liferay Admin user and password. You will need to create a new admin user, and remove the default admin user. Since the default user is the same across all Liferay Portal installations, it needs to be removed for security purposes.

To log in to Liferay, click on the Sign In link at the top right of the screen. The default Email Address and Password are found in the Application name for Liferay Portal Glassfish, which is located in ISPmanager: Server Settings > Applications. Log in to the Liferay Portal with this information.

Once you are logged in, click on Manage at the top left of the screen, and then on Control Panel.

Liferay Control Panel

In the Control Panel menu, under the Portal heading, click on Users.


In the Users screen, click on Add at the top of the screen.

Add User


In the New User screen, enter the Details for the new user, and click on Save when complete.

After you click Save, the User Information screen expands to show more options.

Click on Password, and set a password for this user.

Password


Next, click on Roles. Under the Regular Roles heading, click on Select.

Select Role


In the Roles screen, select Administrator.

Roles

That adds the Administrator role to the newly created user. Click on Save.


Log out as the default user (click on Sign Out at the top right of the screen), and log back in as your newly created user. You will be asked to set a password reminder before you can complete the login process.

Once you have logged in as the new Admin user, go back to Manage > Control Panel > Portal > Users. Click the box to the left of the default Admin user, and then click on Deactivate. This removes the default Admin user.

Using mod_jk or mod_proxy to bypass Apache

The default URL for the Liferay Portal is http://eapps-example.com:8080 (substitute your domain name for eapps-example.com). If you want to have the Liferay Portal available at http://eapps-example.com, you will need to use mod_jk or mod_proxy to bypass Apache and pass the requests for Liferay directly to GlassFish.

mod_jk

To add mod_jk directives, go to Domains > WWW Domains, and click on the domain name to highlight it. Then click on Config. Add the following lines to the VirtualHost settings:

JkMount /* ajp13

Click OK. This will pass all requests from Apache to GlassFish. If you have other applications on the Virtual Server that need to be served by Apache, such as a webmail application or AWStats or phpMyAdmin, you will also need to add no_jk settings to the VirtualHost.

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

SetEnvIf Request_URI "/webmail*" 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

Once you have added your directives, click on OK. Now you will be able to go to http://eapps-example.com/webmail and access SquirrelMail, for example.

mod_proxy_ajp

mod_proxy_ajp is an Apache module, and is available with the Apache web server. No additional application needs to be installed. To add mod_proxy_ajp settings, go to Domains > WWW Domains, and click on the domain name to highlight it. Then click on Config. Add the following lines to the VirtualHost settings:

# Directives for eApps applications dependent on Apache

ProxyPass /webmail !
ProxyPass /awstats !
ProxyPass /myadmin !
ProxyPass /cgi-bin !
ProxyPass /pgadmin !

# Directives for your application

ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/

Click on OK. Now you will be able to go to http://eapps-example.com/webmail and access SquirrelMail, for example.



Comments

Please login to comment