Pages

Wednesday, July 20, 2011

LifeRay Portal Configuration with JBoss and MySql in RHEL

Share it Please

Today we will see how we can configure LifeRay portal server in RHEL5.

The Initial requirements are
Liferay-portal-jboss-6.0.6 (JBoss application server with configured LifeRay, available from LifeRay downloads)
Liferay-portal-sql-6.0.6(Sql Scripts that are used for sample data, available from LifeRay downloads)
My Sql (will be available already in RHEL5)
My Sql GUI tools (available from mysql web site)

Once the packages are available, we will start configuring the LifeRay in JBoss.

1. Let’s start configuring mysql with the sample data for LifeRay portal server to start

 Check whether mysql is already installed in your system, execute
  yum list | grep mysqld (will show the mysql packages if it is installed)

Make sure that mysqld process is enabled in current run level, execute
chkconfig mysqld on

To check the status if it is on in the current run level, execute
chkconfig –list | grep mysqld

Now start the mysqld service, execute
service mysqld restart (if it shows failed at first time ,execute the same command for the second time)

Once the services are restarted and ready, start mysql using
mysql –u root –h localhost –p  (no password here)
It will ask for password, just press enter.

Now we are in the mysql command prompt, let’s start creating the database required for the LifeRay portal server.

create database lportal default character set utf8; (create lportal database with utf8 as default character set)

To check the available database,
show databases;

Now we need to use lportal database to create tables necessary for the LifeRay portal server, execute
use lportal;

now lets create the tables necessary for the LifeRay portal server , execute

source /root/Desktop/create-minimal-mysql.sql;

(I have copied the create-minimal-mysql.sql script from liferay-portal-sql-6.0.6-20110225\liferay-portal-sql-6.0.6\ to desktop)

It will process for a few seconds and tables will be created.

Now check the tables using, show tables;

You can see a long list of tables created in lportal database.

Actually there are 2 sets of sql scripts available, one which will create a LifeRay tables with sample data (portal-mysql.sql) and other which will create bare minimal data (portal-mysql.sql).

Open the SQL administrator from the mysql-gui tools and connect to localhost using port 3306 and username root with no password.

By this we completed the configuration of LifeRay related database in mysql.

2. Create properties file with information about the database and other information.
With every LifeRay, there comes some default properties related to various configurations.
Like the database it uses and other configurations. If we need to override the default configuration with our own, we need to create a new properties file and define our configurations in it. The original one exists deep in the jars, so it will be difficult to change them and providing new properties allows LifeRay to use the overridden configuration only leaving other configuration unchanged.

Create a portal-ext.properties in \liferay-portal-jboss-6.0.6-20110225\liferay-portal-6.0.6\jboss-5.1.0\server\default\deploy\ROOT.war\WEB-INF\classes\

With the following content,

company.default.web.id=Nova.com
terms.of.use.required=false
company.security.strangers=false
# MySQL
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost:3306/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=
jdbc.default.password=
#schema.run.enabled=true
#schema.run.minimal=true


3.Create a Datasource file in the /Server profile/deploy location as
liferay-ds.xml with contents like


<datasources>
   <local-tx-datasource>
     <jndi-name>jdbc/LiferayPool</jndi-name>
     <connection-url>
         jdbc:mysql://localhost:3306/lportal?useUnicode=true&amp;characterEncoding=UTF-8
     </connection-url>
     <driver-class>com.mysql.jdbc.Driver</driver-class>
     <user-name>root</user-name>
     <password></password>
     <min-pool-size>0</min-pool-size>
   </local-tx-datasource>
</datasources>



It says where to find the connection pool .


By this datasource file creation,we have completed the work on Server Side.


Now start the JBoss server.
 run.sh –c default

Once the server starts fine, we can see the following Screen 














Click on the sign in and enter the username as ‘test@liferay.com’ and password ‘test’


















It allows us to login and we see ,






















So we have configured the Liferay with Jboss and Mysql.
So More articles to come.Happy Coding....

No comments :

Post a Comment