How to install LIFERAY on CentOS / RedHat Linux 6.x
WRITE BY MUHAMMAD ZEESHAN BHATTI
Advance Research Project & Technology PVT Ltd.
Email: – [email protected]
PART-1
Step-1
$ yum install java-1.6.0-openjdk-devel –y
Then, set up JAVA_HOME environment variable.
Step -2
$ sh -c ‘echo export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk > /etc/profile.d/java.sh’
Step -3
$ source /etc/profile.d/java.sh
Step -4
We must insert the following lines /etc/profile.d/jave.sh both JDK6 and Liferay Portal
First Parameter Execute on Console
sh -c ‘echo export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk > /etc/profile.d/java.sh’
Second Parameter Execute on Console (FOR TOMCAT)
sh –c ‘echo export LIFERAY_HOME=/usr/liferay/liferay-portal-6.0.5/tomcat-6.0.26 > /etc/profile.d/java.sh’
Second Parameter Execute on Console (FOR JBOSS)
sh -c ‘echo export LIFERAY_HOME=/usr/liferay/liferay-portal-6.0.6/jboss-5.1.0 > /etc/profile.d/java.sh’
Third Parameter Execute on Console
sh –c ‘echo export PATH=$JAVA_HOME/bin:$LIFERAY_HOME/bin:$PATH > /etc/profile.d/java.sh’
Step -5
Ensure that JAVA_HOME and LIFERAY_HOME environment are correctly set. To do this, open a new terminal and type the following commands:
Verify that Syntax is true Echo Print Screen correct Path of Liferay & Java.
Echo $ JAVA_HOME
Echo $ LIFERAY_HOME
PART 2
Install MYSQL Package with yum Repository on Centos.
$ yum install mysql –y
Start Service of MYSQL,
/etc/init.d/mysqld start
MYSQL USER ROOT PASSWORT PROTECTED CONFIGURATION
First Method
/usr/bin/mysql_secure_installation
Second Method
/usr/bin/mysqladmin -u root -h nagios.testdomain.com password ‘redhat’
[root@testserver jboss-5.1.0]# /etc/init.d/mysqld start
Initializing MySQL database: Installing MySQL system tables…
OK
Filling help tables…
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password ‘new-password’
/usr/bin/mysqladmin -u root -h testserver.testdomain.com password ‘new-password’
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
[ OK ]
Starting mysqld: [ OK ]
[root@testserver jboss-5.1.0]# /usr/bin/mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we’ll need the current
password for the root user. If you’ve just installed MySQL, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on…
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
… Success!
Normally, root should only be allowed to connect from ‘localhost’. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
… Success!
By default, MySQL comes with a database named ‘test’ that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
– Dropping test database…
… Success!
– Removing privileges on test database…
… Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
… Success!
Cleaning up…
All done! If you’ve completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
Login MYSQL Server with User Root
mysql –u root –p’ redhat’
Now We Create Database For Liferay.
SQL> CREATE DATABASE lportal DEFAULT CHARACTER SET utf8;
SQL>quit;
PART 3
Create a Directory for Liferay.
Cd /usr && mkdir liferay && cd liferay
Now We Download Liferay Package.
I download and extract Liferay within and the extracted folder to /usr/liferay
WITH TOMCAT
WITH JBOSS
We create the configuration file via vim Portal-Ext.Properties File
cd $LIFERAY_HOME/webapps/ROOT/WEB-INF/classes
vi portal-ext.properties
Please Change Credentials Settings as per Your Need.
##############################
### MY SQL LIFERAY DB SETTING###
##############################
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=redhat
schema.run.enabled=true
schema.run.minimal=true
We set permission of some files as per need to be executable
cd $LIFERAY_HOME/bin
chmod +x *.sh
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
THE END