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!

Comments

  1. hi

    i am new developer in liferay. i have prob in configure MYSQL in liferay.
    i have add one file in LIFERAY_HOME/portal-ext.properties in i have add configuration and after first configuration its work fine but i loging second time then mysql.exe is crash. and no new data are store into database.

    ReplyDelete
  2. Thanks for a great article. Your tips are accurate and they will be of great help to me. I bookmarked your site, will be back ! !

    ReplyDelete
  3. Very good tutorial to understand how to make a Liferay MySQL Database. If any one is interested on how to use other SGBD, the following article can be very useful : http://roufid.com/liferay-database-configuration/

    ReplyDelete

Post a Comment

Popular posts from this blog

Signing SOAP Messages - Generation of Enveloped XML Signatures

How to send an HTML email in Java (Using Google SMTP Server)

Adding Custom Claims to the SAML Response - (How to Write a Custom Claim Handler for WSO2 Identity Server)