Installing Liferay 6.0.5 Community Edition Bundled With Tomcat On Ubuntu 10.04

Liferay Portal is an enterprise web platform for building business solutions that deliver immediate results and long-term value. Get the benefits of packaged applications and an enterprise application framework in a single solution.

For this tutorial I am assuming you are logged in as root and have MySQL server already installed.

I cannot guarantee this will work for you.

 

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-jsp-136632.html and download 'jdk-6u21-linux-x64.bin' to the java directory you created in step 1.

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:

nano /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

 

2. Create the database

Login to MySQL:

mysql -u root –p

Create a database:

CREATE DATABASE lportal DEFAULT CHARACTER SET utf8;
quit;

For this tutorial I will be using the MySQL root account.

 

3. Create a directory for Liferay

mkdir /usr/liferay

 

4. Install Liferay

a) Download and extract the Liferay with Tomcat bundle community edition to /usr/liferay

Liferay can be downloaded here: http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.0.5/liferay-portal-tomcat-6.0.5.zip/download

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

c) Create the Portal-Ext.Properties File

cd $LIFERAY_HOME/webapps/ROOT/WEB-INF/classes
nano 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.

d) Some files need to be executable:

cd $LIFERAY_HOME/bin
chmod +x *.sh

 

5. 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. Please be patient.

$LIFERAY_HOME/bin/startup.sh

To access Liferay navigate to http://<Liferay Server IP ADDRESS>:8080

eg: http://192.168.0.1:8080

 

Oracle: http://www.oracle.com/
MySQL: http://www.mysql.com/
Ubuntu: http://www.ubuntu.com/
Liferay: http://www.liferay.com/

Share this page:

Suggested articles

6 Comment(s)

Add comment

Comments

By:

Hi,

I cannot understand why you are installing Java6 this way.

 I would go for

sudo apt-get install sun-java6-jdk sun-java6-plugin

Once done, run the

sudo update-java-alternatives -s java-6-sun

 command and finally add the line “/usr/lib/jvm/java-6-sun” to the top of the /etc/jvm file (sudo pico /etc/jvm). Save and exit.

To test your Java(TM) setup in the terminal type:-

java -version

If you get an output like below, then you are done!

java version “1.6.0? Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

By:

I sure the way the way you would install java will work fine. After 10 days of failed atempts at getting Liferay to work this was the way I got it going for the first time, so I wrote this tutorial that way.

By: Anonymous

You can use iptables to redirect (nat) port tcp/80 to tcp/8080 so that users don't have to enter the specific port for the liferay portal.. see google for some configuration examples.

By: Anonymous

Or adjust $LIFERAY_HOME/conf/server.xml:

 <Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8" />

By: Anonymous

sir I have a question in this part:

 nano /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

 i don't get i where should I place it

i tried putting it at the bottom part but still it does not work

By: Anonymous

and im not sure on step b, c, and d on step b can i use wget to download java i cant seem to find the right one im currently using vm player 4 for my ubuntu 12.04 and step c is the code really like this:chmod +x jdk-6u21-linux-x64.bin
./jdk-6u21-linux-x64.bin and not like this chmod +x jdk-6u21-linux-x64.bin./jdk-6u21-linux-x64.bin?  

lastly how to to insert the code in step d and where exactly i should place it i can't type it there