Setting up and Configuring a Liferay Portal

Setting up Liferay Portal

As an administrator at the enterprise, you need to undertake a lot of administration tasks, such as installing Liferay portal, installing and setting up databases, and so on.

You can install Liferay Portal through different ways, based on your specific needs. Normally, there are three main installation options:

  • Using an open source bundle—It is the easiest and fastest installation method to install Liferay portal as a bundle. By using a Java SE runtime environment with an embedded database, you simply unzip and run the bundle.
  • Detailed installation procedure—You can install the portal in an existing application server. This option is available for all the supported application servers.
  • Using the extension environment—You can use a full development environment to extend the functionality.

We will take up the third installation option "Using the extension environment" in the coming section.

Using Liferay Portal Bundled with Tomcat 5.5 in Windows

First let's consider one scenario when you, as an administrator, need to install Liferay portal in Windows with MySQL database, and your local Java version is JavaSE 5.0. Let's install Liferay portal bundled with Tomcat 5.5 in Windows as follows:

  1. Download Liferay Portal bundled with Tomcat for JDK 5.0 from Liferay official web site.
    • Unzip the bundled file.
    • Set up MySQL database as follows:
      create database liferay;
      grant all on liferay.* to 'liferay'@'localhost' identified by
      'liferay' with grant option;
      grant all on liferay.* to 'liferay'@'localhost.localdomain'
      identified by 'liferay' with grant option;
  2. Create a database and account in MySQL:
  3. Copy the MySQL JDBC driver mysql.jar to $TOMCAT_DIR/lib/ext;
  4. Comment the Hypersonic data source (HSQL) configuration and uncomment MySQL configuration ($TOMCAT_DIR/conf/Catalina/localhost/ROOT.xml):
    <!-- Hypersonic -->
    <!--<Resource name="jdbc/LiferayPool" auth="Container"
    type="javax.sql.DataSource" driverClassName="org.hsqldb.
    maxActive="20" /> -->
    <!-- MySQL -->
    <Resource name="jdbc/LiferayPool" auth="Container"
    type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.
    maxActive="20" />
  5. Run $TOMCAT_DIR /bin/startup.bat.
  6. Open your browser and go to http://localhost:8080 (here we assume that it is a local installation, otherwise use the real host name or IP).
  7. Login as an administrator—User: and Password: test.

Note that the bundle comes with an embedded HSQL database loaded with sample data from the public website of Liferay. Do not use the Hypersonic in production.

Using Liferay Portal Bundled with Tomcat 6.x in Linux

Let's consider another scenario when you, as an administrator, need to install Liferay portal in Linux with MySQL database, and your local Java version is Java 6.0. Let's install Liferay portal bundled with Tomcat 6.0 in Linux as follows:

  1. Download Liferay Portal bundled with Tomcat 6.0 from Liferay official web site.
  2. Unzip the bundled file.
  3. Create a database and account in MySQL (as stated before).
  4. Run $TOMCAT_DIR/bin/
  5. Open your browser and go to http://localhost:8080 (assuming local installation; otherwise use the real host name or IP).
  6. Log in as an administrator—User: and Password: test.

Note that, Liferay Portal creates the tables it needs along with example data, the first time it starts. Furthermore, it is necessary to make the script executable by running chmod +x It is often necessary to run the executable from the directory where it resides.

Using More Options for Liferay Portal Installation

You can use one of the following options for Servlet containers and full Java EE application servers to install Liferay Portal:

  • Geronimo + Tomcat
  • Glassfish for AIX
  • Glassfish for Linux
  • Glassfish for OSX
  • Glassfish for Solaris
  • Glassfish for Solaris (x86)
  • Glassfish for Windows JBoss + Jetty 4.0
  • JBoss + Tomcat 4.0
  • JBoss + Tomcat 4.2
  • Jetty JOnAS + Jetty
  • JOnAS + Tomcat
  • Pramati
  • Resin
  • Tomcat 5.5 for JDK 1.4
  • Tomcat 5.5 for JDK 5.0
  • Tomcat 6.0

You can choose a preferred bundle according to your requirements and download it from the official download page directly. Simply go to the website and click on Downloads page.

Flexible Deployment Matrix

As an administrator, you can install Liferay Portals on all major application servers, databases, and operating systems. There are over 700 ways to deploy Liferay Portal. Thus, you can reuse your existing resources, stick to your budget and get an immediate return on you investment that everyone can be happy with.

In general, you can install Liferay portal in Linux, UNIX and Windows with any one of the following application servers (or Servlet containers) and by selecting any one of the following database systems.

The applications servers (or Servlet containers) that Liferay Portal can run on, include:

  • Borland ES 6.5
  • Apache Geronimo 2.x
  • Sun GlassFish 2 UR1
  • JBoss 4.0.x, 4.2.x
  • JOnAS 4.8.x
  • JRun 4 Updater 3
  • OracleAS 10.1.3.x
  • Orion 2.0.7
  • Pramati 5.0
  • RexIP 2.5
  • SUN JSAS 9.1
  • WebLogic 8.1 SP4, 9.2, 10
  • WebSphere 5.1, 6.0.x, 6.1.x
  • Jetty 5.1.10
  • Resin 3.0.19
  • Tomcat 5.0.x/5.5.x/6.0.x

Databases that Liferay portal can run on include:

  • Apache Derby
  • IBM DB2
  • Firebird
  • Hypersonic
  • Informix
  • InterBase
  • JDataStore
  • MySQL
  • Oracle
  • PostgresSQL
  • SAP
  • SQL Server
  • Sybase

Operating systems that Liferay portal can run on include:

  • LINUX (Debian, RedHat, SUSE, Ubuntu, and so on.)
  • UNIX (AIX, FreeBSD, HP-UX, OS X, Solaris, and so on.)
  • MAC OS X

How to Configure Liferay Portal?

As an administrator, you may need to customize the Liferay portal through configuration files in order to satisfy your own requirements.

Let's see an example of how to customize Liferay Portal's configuration. In this example, Liferay Portal has been installed using the Tomcat bundle and then a custom theme called "Sesame Street" has been deployed as a WAR. As an administrator, you want this theme to be used by default in any newly created desktop or Community. To achieve that, you look in and find that the property can be used to set the default theme, so that you can create the file in $TOMCAT_DIR/webapps/ROOT/WEB-INFO/classes with the following values:

After a server reboot, these properties are applied to the portal automatically. When your pages (with names HOME, GAMES, VIDEOS, SESAME PLAYLISTS, MUPPETS, and MY STREET) use the theme, "Sesame Street" as Look and Feel, you will get the following figure:

Setting up and Configuring a Liferay Portal

Liferay provides high customizability through the web, and through configuration files. Let's see how to customize mail servers and other configurations.

Customizing Mail Servers

Suppose that the Enterprise has a mail server with the "" domain. As an administrator, you need to integrate this mail server with Liferay portal by default. Let's do it as follows:

  1. Find the file ROOT.xml in $TOMCAT_DIR/conf/Catalina/localhost.
  2. Find the mail configuration.
  3. And then configure it as follows:
<!-- Mail -->
<Resource name="mail/MailSession" auth="Container"

Of course, you can integrate with Washington IMAP+Sendmail, Cyrus IMAP+Postfix, and Dovecot+Postfix, Microsoft Exchange, as well as other IMAP servers.

Configuring Portal Paths

There are two files which are used to configure portal paths: and You should not modify and directly. You should just create two files named and, and write in only the properties whose values you want to override. These two files can be placed with the original one, or in the global classpath of the application server. These two extended files are located at $TOMCAT_DIR/webapps/ROOT/WEB-INFO/classes.

Before customizing the configuration, it is better to review and update the values of the following properties;

  • auto.deploy.deploy.dir=${user.home}/liferay/deploy: enable auto-deploy.
  • lucene.dir=${user.home}/liferay/lucene/: for search to work.
  • jcr.jackrabbit.repository.root=${user.home}/liferay/jackrabbit: for the document library.

Customizing Configuration

We can override the properties of configuration files. Let's configure the portal through the and files that can be created and stored in any place in the class-path. When the extension development environment is used, you will find that these files are already present in the directory ext/ext-impl/WEB-INF/classes. Otherwise, they are stored in the global class-path of the application server. For example:

  • Tomcat: Place them in $TOMCAT_DIR/webapps/ROOT/WEB-INFO/classes.
  • JBoss: Place them in $JBOSS_DIR/server/default/conf.
  • Other application servers: Read the documentation provided with them.

Liferay uses EasyConf to read, so that all functionalities provided by this library are also available.

The main configuration file is, which contains a detailed explanation of the properties that it defines. To change the value of any of its properties, do it through a file called

The file is provided as a convenient way to set all properties for the JVM machine and related system settings. Start your application server with the system property set to true to load it. When the server starts, the portal will load the file and then the file.

What's EasyConf? EasyConf is a library to access the configuration of software components and applications. It defines simple conventions to make it easier to use.

Setting up Extension Environment

As an administrator or a developer from engineering department at the enterprise, you may want to develop an engineering project (for example, collaborating on alfresco contents by Web services) on top of the Liferay portal, like a platform, without having to worry about upgrading in future. You can follow these instructions to set it up:

  • Requirements: Java 1.4 or Java 5.0 or Java 6.0 or a later version; Ant 1.7 or a later version; Liferay Portal source code; Web Server (Tomcat, Resin, and so on).
  • Set JAVA_HOME to your Java directory. Set ANT_HOME to your Ant directory. Add JAVA_HOME/bin and ANT_HOME/bin to System Path.
  • Configuring your compiler (build.${}.properties):
## javac.compiler
## classic (the standard compiler of JDK 1.1/1.2).
## modern (the standard compiler of JDK 1.3/1.4/1.5/1.6).
## jikes (the Jikes compiler).
## jvc (Microsoft's SDK for Java/Visual J++ ).
## kjc (the kopi compiler).
## gcj (the gcj compiler from gcc).
## sj (Symantec java compiler).
## extJavac (run either modern or classic in a JVM of its own).
  • Configuring your release properties.
  • Ant clean start build-ext.
  • Configuring your application server properties.
  • Ant build.
  • Developing your new portlets.

You now can develop and deploy your own custom portlets, themes, and applications.

Furthermore let's consider another scenario. Suppose that you, as an administrator or a developer from an engineering group, want to base your extensions on top of the latest sources of Liferay Portal, instead of using the stable release, you can follow these instructions to set it up:

  1. Download and install Subversion and/or a subversion client such as SmartSVN, TortoiseSVN or those provided by IDE environments.
  2. Configure the client to use the https protocol to connect to
  3. Check out the portal.

The extension environment is a complete development environment that eases customizing Liferay Portal to suit your own needs. It combines many Liferay tools that can probably be used to build your portlets and portals, such as Struts-Portlet, Spring MVC Portlet and Service Builder.

Setting up and Configuring a Liferay Portal

Note that for some projects in which there isn't a need to customize the portal extensively and there is only a need to develop new portlets and themes, you can use the Plugins SDK instead of the extension environment. It is also possible to use both environments at the same time for different needs.


This article discussed how to set up the portal, including installation options and deployment matrix. Then it provided guidance to configure the portal based on the and files, and set up extension environment in order to extend functionality briefly.

You've been reading and excerpt of:

Liferay Portal Enterprise Intranets

Explore Title
comments powered by Disqus