Liferay on CloudBees

Liferay on CloudBees

Last modified by Francois Dechery on 2012/12/15 22:00

Want to avoid the manual setup?

We understand that reading all the docs or setting all the parameters can get tedious, which is why you can get a full Liferay installation working in 2 clicks by clicking on this link: Liferay ClickStart

(Please note that you will need to enter your billing information first, as Liferay requires 512MB of RAM at least, which is not part of our free plans, unfortunately.) 

Manual Setup

Liferay is one of the most popular Java-based portals in the market. This document outlines the 3 steps required to run Liferay on CloudBees.

Create Database

Create a new database in your CloudBees account. This database will be populated by the liferway war during deployment. You can create a new database by clicking the "New Database" link on the left handside of the CloudBees console. 

Screenshot2011-09-16at4.10.33PM.png

Repackage Liferay war for deployment

Package war to have all necessary jars for standalone deployment

You need to bundle jars from the liferay tomcat bundle lib/ext directory into the liferay war file.

  1. Download and un-jar the pure non-app-server-bundled Liferay war into a temporary directory. 
  2. Download and un-jar the Liferay Tomcat Bundle into some other place (for example /tmp/lr-606-bundle). 
  3. Copy all of the global jar files from the Liferay Tomcat Bundle in lib/ext to your custom Liferay WAR file directory
mkdir liferay-cb-war
cp liferay-portal-6.0.6-20110225.war ./liferay-cb-war
jar xvf liferay-portal-6.0.6-20110225.war

cp /tmp/lr-606-bundle/liferay-portal-6.0.6/tomcat-6.0.29/lib/ext/*.jar /tmp/lr-cb-war/WEB-INF/lib
Create and edit portal-ext.properties file

The portal-ext.properties file should be updated to have database and lucene related information. 

portal-ext.propertiesliferay.home=/tmp/liferay-home-eb
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://yourdatabase:3306/liferay-username?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=liferay-username
jdbc.default.password=liferay-password
#lucene.store.type=ram
#lucene.store.jdbc.auto.clean.up.enabled=true
Repackage war

Update the standalone war to include the java libraries and portal-ext.properties

cd /tmp/lr-cb-war
jar uvf path-to-war/liferay-portal-6.0.6-20110225.war WEB-INF/classes/portal-ext.properties WEB-INF/lib/*.jar
Deploy Liferay war on CloudBees
Create a new app on CloudBees.

Screenshot2011-09-16at4.12.17PM.png

The liferay war is pretty huge and requires quite a bit of memory. Go to your app configuration page and select either medium or large configuration to start your application with. Liferay requires 256M of permgen space, see JVM PermGen Space to setup the permgen space.

Deploy the war

Download the CloudBees SDK and deploy the war file. It is a huge war file - so it takes a couple of minutes to deploy. Since the SDK does delta deployments, subsequent redeploys are very fast.

bees app:deploy liferay-portal-6.0.6-20110225.war jvmPermSize=256 

At this point you should have a running instance of Liferay on CloudBees.

Tags:
Created by Harpreet Singh on 2011/09/16 23:21