Saturday, November 16, 2013

Install Liferay over a MySQL Database

With this post I will share how to get started with Liferay Portal including initial configurations and login.

Environment: Linux

Pre-requisites :


Let's download the Liferay pack from here.

I got the Community Edition of bundle with Tomcat.

Extract it to a folder of your choice, let's call the extracted folder LR_HOME. Ok, the resources are ready.. Let's go..

MySQL

Login to MySQL. If you just installed following command will do.

mysql -uroot -p

Enter the password (default root).

Create database to be used for Liferay.

create database lportal;

Create user for Liferay.
create user 'lr_user'@'localhost' identified by 'user123';


Give access to the created database for this user.
grant all privileges on lportal.* to 'lr_user'@'localhost' with grant option;

Mysql work is over now. Let's go to Liferay.

LifeRay

Go to LR_HOME.
Inside LR_HOME create file with the name 'portal-ext.properties'. This is an option provided by the Liferay architecture to override default configurations.
Copy the following content to the file.

#

#MySQL

#

jdbc.default.driverClassName=com.mysql.jdbc.Driver

jdbc.default.url=jdbc:mysql://localhost/lportal?

useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false

jdbc.default.username=lr_user

jdbc.default.password=user123

Fill the values according to the created database.

Go inside the tomcat folder in LR_HOME and issue the following command to start it.
bin/startup.sh


This will trigger the start and to see how it goes issue the following command to observe the logs.
tail -f logs/catalina.out

This will take some time at start up, since it is creating the databases. It will finally print server started in ?? ms and a new window will be automatically open in Firefox for 'http://localhost:8080/'. This is the Liferay Portal welcome page.





Login as the default admin 'test@liferay.com' with password 'test', this will get us through wizard and allow us to change the default password.

Now we are in the portal.....
Cheers!