HomeDocumentation > Apache Geronimo v1.1 - User's Guide > Administration > Configuring Portals - Liferay

Geronimo does not provide any portal server capabilities out of the box. The Geronimo Administration Console is a web application that has Apache Pluto already embedded within the application itself for portlets support, this does not mean that Geronimo per se is a portal server.

The Geronimo Administration Console is the one providing Pluto integration within it's own WAR. All the portal configurations ( navigation, layout, available portlets, etc. ) are already provided inside that WAR via XML files.

So, if you want to run portlets in Geronimo you could do the same, embed Apache Pluto within your own WAR, but there is also another alternative. You could install on Geronimo a full portal server such as Liferay.

Liferay is available as a Geronimo Plugin (Geronimo-Tomcat distribution only) and you can install it via the Geronimo Administration Console or a command line. This portal server comes in two separate plugins, one needs to installed before the other. That is the server plugin will require the database a connection pool to be created first.

The Liferay plugin will use the Geronimo embedded Derby database but you may want to choose a different platform. Later on in this article we will describe how to configure a MySQL database and connection pool.

Install Liferay plugin via Geronimo Administration Console

For this scenario we will use just the default database so you can see how simple the process can be.

  • Once in the Geronimo Administration Console locate Plugins and click on Create/Install on the left navigation menu.
  • Click on Add Repository.
  • Add this URL : http://geronimo.liferay.com/plugins/
  • Now select that URL from the drop down list and click the Search for Plugins button
  • Install and start the liferay-pool plugin (this is the database and connection pool for Liferay)
  • Install and start the liferay-portal-tomcat plugin
  • Your portal should now be accessible at http://localhost:8080/ (it may take a few seconds to load the first time)

Congrats! you now have a portal server running on Geronimo, check Liferay Documentation for details on how to configure the portal server.

Install Liferay plugin via command line

In the previous section you saw how easy is to install the plugins from the console. Using the command line is just as easy, but this time we will download the plugin manually first and then create a custom connection pool to use an external database.

Download the plugin from http://www.liferay.com/web/guest/downloads , look into the Application Server Plugins section. You should find something similar to this:

Geronimo: liferay-portal-geronimo-tomcat-4.2.1.car (be sure you install liferay-portal-geronimo-derby-pool-4.2.1.car first)

For this particular case, Liferay portal 4.2.1 for Geronimo Tomcat distribution.

We mentioned earlier that we would use a different database for this example so now we will provide additional steps for configuring the remote database. We assume you have already installed MySQL 5.

Create database schema and populate initial data

  • Download and extract the database schema scripts available on http://www.liferay.com/web/guest/downloads , see Database Scripts.
  • Create and populate the portal database, for this particular case we will be using create-mysql.sql.
    from a MySQL command line client run

    \. <scripts_home>\create\create-mysql.sql

    Note that this command may take some time to run. This concludes the initial database configuration, now we need to define a connection pool in Geronimo.

Create the required database connection pool

Liferay portal server plugin will be expecting to find a connection pool named LiferayPool and with the following moduleId liferay/liferay-pool/4.2.1/car. So we will create a deployment plan and deploy this connection pool from the command line.

Before we can deploy the connection pool we need to install in Geronimo the appropriate MySQL connector drivers. This is a simple task to do, follow these steps from the Geronimo Administration Console:

  • Download the mysql-connector-java from the MySQL Downloads site. For this particular case we will be using mysql-connector-java-5.0.5-bin.jar.
  • From the Geronimo Administration Console click on Common Libs.
  • Click on Browse and specify the location for the mysql-connector-java-5.0.5-bin.jar file you just downloaded.
  • Make sure the remaining fields reflect the following values:

    Group:

    mysql

    Artifact:

    mysql-connector-java

    Version:

    5.0.5

    Type:

    jar

  • Click on Install, this will copy the drivers into the local Geronimo repository.

Now we are ready for the next step, deploy the connection pool.

Create a deployment plan named liferay-pool_mysql.xml as shown in the following example.

liferay-pool_mysql.xml
Icon

Make sure you update ConnectionURL, UserName and Password to your local values before deploying the plan.

Deploy the connection pool by running the following command from the <geronimo_home>/bin directory:

deploy --user system --password manager deploy <plans_home>\liferay-pool_mysql.xml ..\repository\tranql\tranql-connector\1.2\tranql-connector-1.2.rar

You should see a confirmation message similar to this one:

d:\geronimo-1.1.1-Tomcat\bin>deploy --user system --password manager deploy \plans\liferay-pool_mysql.xml ..\repository\tranql\tranql-connector\1.2\tranql-connector-1.2.rar
Using GERONIMO_BASE:   D:\geronimo-1.1.1-Tomcat
Using GERONIMO_HOME:   D:\geronimo-1.1.1-Tomcat
Using GERONIMO_TMPDIR: D:\geronimo-1.1.1-Tomcat\var\temp
Using JRE_HOME:        C:\Java\jdk1.5.0_06\
    Deployed liferay/liferay-pool/4.2.1/car

Install the server plugin

With the server plugin requirements fulfilled run the following command to install and start the Liferay portal server.

deploy --user system --password manager install-plugin <Liferay_plugin_home>/liferay-portal-geronimo-tomcat-4.2.1.car

Icon

Installing a downloaded copy of the plugin from the command line may require you to first uninstall the Welcome application in order to avoid a conflict at the web server's context root ('/'). Installing the plugin from a plugin repository employs a feature of the plugin installer that automatically uninstalls the Welcome application for you.

This step may take some time to run, when finished you should see a confirmation message similar to this one:

D:\geronimo-1.1.1-Tomcat\bin>deploy --user system --password manager install-plugin \Liferay\liferay-portal-geronimo-tomcat-4.2.1.car
Using GERONIMO_BASE:   D:\geronimo-1.1.1-Tomcat
Using GERONIMO_HOME:   D:\geronimo-1.1.1-Tomcat
Using GERONIMO_TMPDIR: D:\geronimo-1.1.1-Tomcat\var\temp
Using JRE_HOME:        C:\Java\jdk1.5.0_06\
Checking for status every 1000ms:
null (7%)
null (8%)
null (9%)
null (10%)
null (11%)
null (12%)
null (13%)
null (14%)
null (23%)
null (27%)
null (31%)
null (34%)
null (38%)
null (42%)
null (45%)
null (46%)
null (50%)
null (54%)
Finished installing liferay/liferay-portal-tomcat/4.2.1/car (65365 kB) (100%)

    **** Installation Complete!
    Used existing: geronimo/j2ee-server//car
    Used existing: geronimo/j2ee-security//car
    Used existing: geronimo/rmi-naming//car
    Used existing: geronimo/geronimo-mail//jar
    Used existing:
    org.apache.geronimo.specs/geronimo-javamail_1.3.1_spec//jar
    Used existing: liferay/liferay-pool//car
    Used existing: geronimo/tomcat//car

    Downloaded 65365 kB in 38s (1720 kB/s)
    Now starting liferay/liferay-portal-tomcat/4.2.1/car...

    Started liferay/liferay-portal-tomcat/4.2.1/car @
    http://localhost:8080/

The Geronimo terminal should also display a message similar to this one:

############################################################
# Installed configuration
#   id = liferay/liferay-portal-tomcat/4.2.1/car
#   location = D:\geronimo-1.1.1-Tomcat\repository\liferay\liferay-portal-tomcat\4.2.1\liferay-portal-tomcat-4.2.1.car
############################################################
Loading jar:file:/D:/geronimo-1.1.1-Tomcat/repository/liferay/liferay-portal-tomcat/4.2.1/liferay-portal-tomcat-4.2.1.car/WEB-INF/lib/portal-ejb.jar!/system.properties
Loading jar:file:/D:/geronimo-1.1.1-Tomcat/repository/liferay/liferay-portal-tomcat/4.2.1/liferay-portal-tomcat-4.2.1.car/WEB-INF/lib/portal-ejb.jar!/portal.properties
Starting Liferay Portal Professional 4.2.1 (Machen / Build 3501 / January 10, 2007)
15:18:43,937 INFO  [DynamicDialect] Determining dialect for MySQL 5
15:18:43,953 INFO  [DynamicDialect] Using dialect org.hibernate.dialect.MySQLDialect
Loading jar:file:/D:/geronimo-1.1.1-Tomcat/repository/liferay/liferay-portal-tomcat/4.2.1/liferay-portal-tomcat-4.2.1.car/WEB-INF/lib/portal-ejb.jar!/cache-multi-vm.properties
15:18:53,843 INFO  [HotDeployUtil] Initializing hot deploy manager 27651713
15:18:53,890 INFO  [ServerDetector] Detected server geronimo
15:18:54,078 INFO  [AutoDeployDir] Auto deploy scanner started for \home\liferay\deploy

Once started it should have created a \home\liferay\deploy directory on the same drive/file system where Geronimo resides. This directory can be used to deploy portlets and templates from the command line.

You can now access the Liferay portal server by pointing your browser to the following URL:

http://localhost:8080/

Note that it may take some time the first time you access the server. Refer to the Liferay documentation available at http://www.liferay.com/web/guest/documentation for details on how to configure the server.

Summary

This article showed two different ways to install a Geronimo plugin as well as an alternative configuration for the Liferay portal server plugin for Geronimo.
This article is not intended to provide detailed instructions for configuring and using Liferay, instead the focus is on configuring Geronimo to support Liferay.