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:
After the prerequisites were installed, proceed with downloading Liferay Portal bundled with Tomcat 5.5 from Liferay Downloads Page:
cd /root/work wget http://downloads.sourceforge.net/lportal/liferay-portal-tomcat-5.5-5.2.3.zip
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/portal-ext.properties and fit it with following contents:
# # PostgreSQL # jdbc.default.driverClassName=org.postgresql.Driver jdbc.default.url=jdbc:postgresql://localhost:5432/lf_db jdbc.default.username=lf_usr jdbc.default.password=pa$$W0rD
Where:
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 portal.properties 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 startLiferay.sh with the following contents:
#!/bin/bash CATALINA_HOME=/opt/liferay/tomcat-5.5.27 # Start Liferay $CATALINA_HOME/bin/startup.sh
Start the script, check the logs and connect to Liferay with links:
./startLiferay.sh tail -f $CATALINA_HOME/logs/catalina.out links http://127.0.0.1:8080
The user with administration privileges has the following credentials:
Email addres: test@liferay.com
Password: test