Installing Liferay on Jetty 7

Liferay Home is one folder above Jetty’s install location.

For this section, we’ll refer to Jetty server’s installation location as $JETTY_HOME. If you do not already have an existing Jetty server, we recommend you download a Liferay/Jetty bundle from http://www.liferay.com/downloads/liferay-portal/available-releases. If you have an existing Jetty server or would like to install Liferay on Jetty manually, please follow the steps below.

Before you begin, make sure you have downloaded the latest Liferay .war file and Liferay Portal dependencies from http://www.liferay.com/downloads/liferay-portal/additional-files. The Liferay .war file should be called liferay-portal-6.1.x-<date>.war and the dependencies file should be called liferay-portal-dependencies-6.1.x-<date>.zip.

Now that you have all of your installation files, you’re ready to start installing and configuring Liferay on Jetty.

Unzip the jar files found in the Liferay Portal Dependencies zip file to your $JETTY_HOME/lib/ext/liferay folder. Take care to extract the zip file’s .jar files directly into this folder.

Next, you need several .jar files which are included as part of the Liferay source distribution. Many application servers ship with these already on the class path but Jetty does not. The best way to get the appropriate versions of these files is to download the Liferay source code and get them from there. Once you have downloaded the Liferay source, unzip the source into a temporary folder. We’ll refer to the location of the Liferay source as $LIFERAY_SOURCE.

Make sure the JDBC driver for your database is accessible to Jetty. Obtain the JDBC driver for your version of the database server. In the case of MySQL, use mysql-connector-java-{$version}-bin.jar. You can download the latest MySQL JDBC driver from http://www.mysql.com/products/connector/. Extract the JAR file and copy it to $JETTY_HOME/lib/ext/liferay.

If you want to manage your data source within Jetty, continue following the instructions in this section. If you want to use the built-in Liferay data source, you can skip this section.

Management of databases in Jetty is done via the file $JETTY_HOME/etc/jetty.xml. Edit jetty.xml and insert the following text within the root element <Configure> to specify the data pool for your data source. Be sure to pass in value jdbc/LiferayPool as the second argument.

Your data pool needs Jetty’s JNDI and Jetty Plus libraries loaded to access those classes at runtime. Your $JETTY_HOME/etc/start.config file should have sections that load these libraries as long as jndi and plusoptions are specified at startup.

To set these options, edit your $JETTY_HOME/bin/start.ini file and add jndi and plus as values for the OPTIONS variable:

OPTIONS=Server,jsp,resources,jndi,plus

Super! Now you have your database specified and ready for use with Liferay on Jetty. Let’s consider your mail session next.

If you want to manage your mail session within Jetty, use the following instructions. If you want to use the built-in Liferay mail session, you can skip this section.

Management of mail sessions in Jetty is done via the configuration file $JETTY_HOME/etc/jetty.xml. Edit jetty.xml and insert the following text within the root element <Configure> to specify your mail session. Be sure to pass in value mail/MailSession as the first argument and to replace the mail session values with your own.

Let’s revisit your configuration to make sure we’ll be able to access your data source and mail session from Liferay Portal.

First, navigate to the Liferay Home folder, which is one folder above Jetty’s install location. Create a file named portal-ext.properties.

If you are using Jetty to manage your data source, add the following to your portal-ext.properties file in your Liferay Home to refer to your data source:

jdbc.default.jndi.name=jdbc/LiferayPool

Otherwise, if you are using Liferay Portal to manage your data source, follow the instructions in the Deploy Liferay section for using the setup wizard.

If want to use Liferay Portal to manage your mail session, you can configure the mail session within Liferay Portal. That is, after starting your portal as described in the Deploy Liferay section, go to Control Panel → Server Administration → Mail and enter the settings for your mail session.

Otherwise, if you are using Jetty to manage your mail session, add the following to your portal-ext.properties file to reference that mail session:

Liferay can be deployed as an exploded web archive within $JETTY_HOME/webapps.

If you already have an application folder $JETTY_HOME/webapps/root, delete it or move it to a location outside of $JETTY_HOME/webapps.

Then extract the contents of the Liferay portal .war file into $JETTY_HOME/webapps/root.

Before you start Liferay Portal, let’s consider whether you want to also start the setup wizard.

Start the setup wizard along with Liferay Portal - Do this if you want to configure your portal, setup your site’s administrative account and/or manage your database within Liferay.

If this is your first time starting Liferay Portal 6.1, the setup wizard is invoked on server startup. If you want to re-run the wizard, specify setup.wizard.enabled=true in your properties file (e.g. portal-setup-wizard.properties).

setup.wizard.enabled=true

The setup wizard is invoked during server startup.

Start Liferay Portal without invoking the setup wizard - Do this if want to preserve your current portal settings.

To start the server without triggering the setup wizard, specify setup.wizard.enabled=false in your properties (e.g. portal-setup-wizard.properties or portal-ext.properties file).

setup.wizard.enabled=false

The portal-setup-wizard.properties file the setup wizard creates has setup.wizard.enabled=false conveniently specified for you.