Liferay Portal installation for enterprise intranets

Liferay Portal is one of the world's leading Open Source portal platform which uses Java and Web 2.0 technologies. It is used by many non-profit, hi-tech and governamental organizations all over the world (GoodWill, Cisco, World Vision, CDHS, Pantech etc.) to implement change, streamline processes and meet their unique needs.

This post describes the installation of Liferay Bundled with Tomcat 5.5 on CentOS server. The PostgreSQL will be used as a back-end database.

Install prerequisites. Start with Java and PostgreSQL. Use the below guides for reference:

  1. Install Java on CentOS/Redhat/Fedora
  2. Install and configure PostgreSQL database server on CentOS/Redhat/Fedora

After the prerequisites were installed, proceed with downloading Liferay Portal bundled with Tomcat 5.5 from Liferay Downloads Page:

cd /root/work

When download is completed, unzip the bundled file:

unzip liferay-portal-tomcat-*.zip

Make shell scripts executable, because unzipping the archive leaves the shell scripts not-executable:

chmod +x /root/work/liferay-portal-tomcat-5.5-5.2.3/tomcat-5.5.27/bin/*.sh

Add system user tomcat with uid and gid 1002. This user will be used to start Liferay (instead of root):

adduser --uid 1002 tomcat

After that, move the Liferay to the /opt/liferay folder and change the permissions:

mv /root/work/liferay-portal-5.2.3/ /opt/liferay
cd /opt/liferay
chown -R tomcat:tomcat .

Liferay it is installed. It is time to proceed to the configuration. Liferay should be configured to use PostgreSQL database.

For this, create and open file ./tomcat-5.5.27/webapps/ROOT/WEB-INF/classes/ and fit it with following contents:

# PostgreSQL

lf_db – PostgreSQL database name
lf_usr – database user for database lf_db
pa$$W0rD – password for user lf_usr

Note: If you intend to use other types of databases rather than PostgreSQL, use the file from official SVN. In this file you should find the connection properties for MySQL, Sybase, Oracle etc.

The configuration is completed. It is time to create a small script that will start Liferay. Change to tomcat user:

su - tomcat

and create a file with the following contents:


# Start Liferay

Start the script, check the logs and connect to Liferay with links:

tail -f $CATALINA_HOME/logs/catalina.out

The user with administration privileges has the following credentials:

Email addres:
Password: test