Techminded

Install Liferay 6 on Linux with external MySQL database

Introduction

Liferay is bundled with HSQL database included, but you can install with external database usage enabled. Assume you have installation of MySQL and your linux distribution is not very different from Ubuntu, CentOS or other widely used.

Database

First of all check your database server supports TCP connections in addition to default socket. You should have the following line uncommented in [mysqld] section of /etc/mysql/my.cnf configuration file:

bind-address		= 127.0.0.1

Next login to myql and create database and user:

$mysql -u root -p
mysql> create database lportal character set utf8;
mysql> grant all privileges on lportal.* to 'lportal'@'localhost' identified by 'lportal';

You must choose other password in order this is not your development couputer. Exit with Ctrl+D and start to setup the distribution

Download Portal SQL Scripts the following url: http://www.liferay.com/downloads/liferay-portal/available-releases

unpack it somwhere you want and run MySQL creation script:

mysql -u lportal -p lportal < /path/to/place/you/unpacked/file/liferay-portal-sql-6.x.x-ce-ga1/create/create-mysql.sql

Distribution

Download archive with tomcat budled from the following url: http://www.liferay.com/downloads/liferay-portal/available-releases

Unzip it inside /opt directory

#cd /opt
#unzip liferay-portal-tomcat-6.x.x-ce-ga1-xxxxxxxxxxx.zip

sothat you will have data  license  readme.html  tomcat-7.0.23 dirs and files in  liferay-portal-6.x.x-ce-ga1

Setup

Remove Liferay generated stuff:

#cd /opt/liferay-portal-6.x.x-ce-ga1/tomcat-x.x.x/webapps/
#rm sevencogs* -rf

Create configuration file with name+path /webapps/ROOT/WEB-INF/classes/portal-ext.properties and the following contents:

#
# 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=lportal
jdbc.default.password=lportal
schema.run.enabled=true
schema.run.minimal=true

Now start your liferray

#/opt/liferay-portal-6.x.x-ce-ga1/tomcat-x.x.x/bin/startup.sh

and wait until browser opens, if it's not try open url http://localhost:8080 manually after few minutes. If you see nothing check tomcat log files:

#cat /opt/liferay-portal-6.x.x-ce-ga1/tomcat-x.x.x/logs/catalina.dddd-mm-dd.log

If you see broser widow with setup wizard you almost there and can do other stuff yourself.

Comments