Friday, March 30, 2012

liferay installation on cloud


Installing Liferay 6.0.5 Community Edition Bundled With Tomcat

1. Install Java JDK
a) First we will create a directory for java:
mkdir /usr/java
b) Now we must download the JDK.
For this tutorial I will be using the 64bit version, if you are using the 32bit version of Ubuntu you will need to download the i586 version.
Go to http://www.oracle.com/technetwork/java/javase/downloads/jdk6.0.5-jsp-136632.html and download 'jdk-6u21-linux-x64.bin' to the java directory you created in step 1.
Or
You can directly get using
Yum install java
c) Now we will make the bin file executable and run it:
cd /usr/java
chmod +x jdk-6u21-linux-x64.bin
./jdk-6u21-linux-x64.bin
d) We must insert the following lines inside /etc/profile for both JDK6 and Liferay Portal.
Open /etc/profile:
vi /etc/profile
Insert the following lines on a new line at the bottom of the file:
export JAVA_HOME=/usr/java/jdk1.6.0_21
export LIFERAY_HOME=/usr/liferay/liferay-portal-6.0.5/tomcat-6.0.26
export PATH=$JAVA_HOME/bin:$LIFERAY_HOME/bin:$PATH
e) Ensure that JAVA_HOME and LIFERAY_HOME environment are correctly set. To do this, open a new terminal and type the following commands:
echo $JAVA_HOME
echo $LIFERAY_HOME

mysql
If mysql is not installed then we have to first install it.
Yum install mysql-server mysql-client mysql
/etc/init.d/service mysql start

 Install Liferay
Create a directory for Liferay
mkdir /usr/liferay
Download and extract the Liferay with Tomcat bundle community edition to /usr/liferay
As I am primarily a Windows user I download and extract Liferay within Windows and copy the extracted folder to /usr/liferay using WinSCP.
b) If you plan to use this installation in a production environment remove the default bundled sample data from $LIFERAY_HOME/webapps
Delete these folders:
sevencogs-hook
sevencogs-mobile-theme
sevencogs-theme
 Create the Portal-Ext.Properties File
cd $LIFERAY_HOME/webapps/ROOT/WEB-INF/classes
vi portal-ext.properties
Insert the following:
#
# MySQL
#
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEn
coding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=password
schema.run.enabled=true
schema.run.minimal=true
Change the username and password as desired.

Some files need to be executable:
cd $LIFERAY_HOME/bin
chmod +x *.sh
Run Liferay
The following command starts Liferay, initial startup may take some time (10 to 15 mins depending on hardware) as the database is created etc.
$LIFERAY_HOME/bin/startup.sh
To access Liferay navigate to http://<Liferay Server IP ADDRESS>:8080(default)

Your Reviews/Queries Are Accepted