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.
xmlliferay-pool_mysql.xmlsolidMake 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:
#000000solid
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
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:
#000000solid
The Geronimo terminal should also display a message similar to this one:
#000000solid
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:
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.