Documentation
Liferay provides a rich store of resources and knowledge to help our community better use and work with our technology.
Installing Liferay for an Enterprise
Eventually, you will want to install Liferay onto a real server, rather than on a developer's machine. It is easiest to do this by starting with a bundle and then reconfiguring that bundle so that it is enterprise-ready. Because this is by far the quickest and easiest method to get a production Liferay system running, we will look at this first. Often, however, enterprises will have an established Java EE infrastructure upon which they would like to install Liferay. In this situation, a bundle will not suffice. Most of this section, therefore, will focus on installing Liferay onto an already-established application server.
Illustration 5: SQL Scripts Folder StructureDatabase Setup
Regardless of which method is used to install Liferay, you will need to configure the Liferay database first. Even though Liferay can now create its database automatically, many enterprises prefer not to allow the user ID configured in an application server to have that many permissions over the database. For security reasons, Select, Insert, Update, and Delete are generally all the permissions that most DBAs will grant, and so we will go over how to set up the database manually. If your organization's DBAs are willing to grant the Liferay user ID permissions to create and drop tables in the database—and this is the recommended configuration—you can skip this section.
One other caveat is this: Liferay has an automatic database upgrade function which runs when the version of Liferay is upgraded to a new release. If the user ID that accesses the database does not have enough rights to create / modify / drop tables in the database, you will need to grant those rights to the ID before you start your upgraded Liferay for the first time. Once the upgrade is complete, you can remove those rights until the next upgrade.
Liferay provides an SQL script archive download on the web site. It is in the Additional Files section of the Downloads page. Download this file and unzip it. You will find that it contains a folder structure that is broken down by the type of script (full, minimal, or upgrade), and then further by database vendor type.
It is best to use the create-minimal script if you are installing a fresh version of Liferay on development, QA, or production server. This script creates the necessary Liferay tables in the database, with a minimum configuration. This is most appropriate for a new installation of Liferay.
The create script, by contrast, configures a Liferay database with a portion of the content from http://www.liferay.com embedded in it. This can be useful from a development perspective, as it contains working examples of the use of many of Liferay's features, including the Journal Content Management System.
Inside the create or create-minimal folders are scripts for every database that Liferay supports. A DBA can use the script provided to create the Liferay database, complete with the indexes necessary for optimal performance. Once this is done, be sure that the ID that the portal will use to connect to the database has at least Select, Insert, Update, and Delete permissions. Preferably, however, the ID should also have rights to create, modify, and drop tables and indexes, as this makes upgrading easier. This, however, is not necessary for the daily operation of Liferay.
Once your DBA has created the database and provided the credentials for accessing it, you are ready to begin 1) making a bundle enterprise-ready or 2) manually installing Liferay on your application server.
Turning a Bundle into an Enterprise Portal
Liferay Portal is distributed with the following bundle options for servlet containers and full Java EE application servers:
Geronimo+Tomcat
Glassfish
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
Choose your preferred bundle and download it from the downloads page on Liferay's web site. A prerequisite for running any of the bundles is that you have the proper version of Java (1.4 or 1.5) installed on the machine to which you are installing Liferay. Make sure that you have also created the JAVA_HOME variable and have pointed it to your Java installation.
Unzip the bundle to the location from which you are going to run it. For example, you might use c:\apps in Windows or /usr/local/ in Linux or UNIX variants. The default bundle installation of Liferay Portal uses an embedded database. While this is a good method to have it up and running fast for reviewing or developing, it has several drawbacks:
Only one user can access it at a time. This is because the data is stored on a file on disk and HSQL locks it when doing changes.
The data is stored inside the application server and might be lost on redeployment.
This configuration does not scale well and will have performance problems when multiple users are accessing the system.
Obviously, you do not want to be running Liferay against the embedded database. Fortunately, Liferay has great support for a good number of production-ready databases, and it is easy to configure Liferay to use them. The exact instructions will depend on the application server and database, but can be summarized as:
Create the database in your DBMS of choice (see the above section labeled Database Setup for further information).
Reconfigure the Data Source named LiferayPool in your Application Server or servlet container to point to the recently created database. The bundles by default have this configured to go to the embedded database.
Reconfigure the Mail resource to point to the mail server Liferay will use to send notifications.
Start Liferay. If your DBAs have given the Create Table permissions to the user ID Liferay will be using to connect to the database, Liferay will create the tables automatically and start. Otherwise, you will have had to prepare the database first by running the appropriate create script.
Refer to the manual installation instructions below for further details on configuring the various application servers. There is no difference between the Liferay bundles and the regular distribution archives of the application servers as they are available from their own sites, with the exception that Liferay is pre-installed in them.
Further Configuration
The configuration in the bundle is set to connect to a mail server installed on the same machine as the application server (referred to as localhost in the configuration). It also assumes that certain paths are present in the system. You will likely need to customize these settings for your particular environment. We will go over these settings in Chapter Two.
Installing Liferay on an Existing Application Server
This section contains detailed instructions for installing Liferay Portal using its WAR distribution. This allows system administrators to deploy Liferay in existing application server installations. It is recommended that you have a good understanding of how to deploy Java EE applications in your application server of choice.
Please note that while Liferay Portal supports a wide rage of databases, for brevity this section assumes MySQL as the database and that the database has already been created. To use other databases, substitute the JDBC driver and URL construct for your database in place of the MySQL ones shown here. We also assume your application server is already installed and running successfully. If you still need to install your application server, please follow your vendor's instructions first.
The following instructions assume an installation on a local machine. When installing to a remote server, substitute localhost with the host name or IP of the server.
Tip: Note that Liferay 5.x requires JDK 1.5 or greater. Do not attempt to install Liferay 5.x on an application server that runs under Java 1.4 or lower; it will not work. If you are running an application server that ships with a JDK and that JDK is 1.4 or lower, you will need to upgrade your application server in order to user Liferay 5.x. Liferay 4.x, however, will run fine on these application servers. Geronimo 1.1 with Tomcat 5.0.28/5.5.17
Download and install Geronimo/Tomcat into your preferred directory. From now on, the directory where you installed Geronimo will be referred to as GERONIMO_HOME.
Download and install JDK 5. Set an environment variable called JAVA_HOME to point to your JDK directory.
Download the WAR for the latest available version of Liferay Portal.
Edit GERONIMO_HOME\bin\geronimo.bat (Windows) or geronimo.sh (Linux). Insert at approximately line 219:
set JAVA_OPTS=-Xms128m -Xmx512m -Dfile.encoding=UTF8 -Duser.timezone=GMT
Download the Portal Dependencies.
Point browser to http://localhost:8080/console to enter Administration Console. Login in as User: system and Password: manager.
Click Common Libs under Services. Click Browse, find portal-kernel.jar and add
Group: Liferay
Artifact: Portal-kernel
Version: enter version number of jar
Type: Jar
Click Install
Repeat the last step for each of the libraries in the dependencies ZIP file.
Click Database Pools under Services. Click Using the Geronimo database pool wizard.
Name of Database Pool: LiferayPool
Database Type: MySQL
Click Next
Driver Jar: click Download a Driver and select MySQL Connector/J
Click Next
DB User Name: <none>
DB Password: <none>
Port: 3306 (default)
Host: localhost
Database: lportal
Click Next
Click Test Connection
Click Deploy
Click Deploy New under Applications.
Archive: Browse for liferay-portal-x.x.x.war (substitute x with the version you've downloaded)
Click Install
Click Web App WARs.
Uninstall geronimo/welcome-tomcat/1.1/car
Start -default/liferayportal/xxxxxxx.../war
Open your browser to http://localhost:8080. You should see the default Liferay home page.
Glassfish 2.x
Download the latest liferay-portal-x.x.x.war and dependencies.
Copy the dependencies .jars into $GLASSFISH_HOME/domains/domain1/lib, where $GLASSFISH_HOME is the directory where Glassfish is installed.
Copy xercesImpl.jar and JDBC driver into the same place.
Start Glassfish if it hasn't already been started. Go to the Glassfish Administration Console at http://localhost:4848.
Default login credentials are user name: admin; password: adminadmin.
Illustration 6: Glassfish JDBC Connection PoolUnder Other Tasks, select Create New JDBC Connection Pool.
In the first screen, give it a name of LiferayPool, a Resource Type of javax.sql.ConnectionPoolDataSource, and select MySQL as the Database Vendor. Click Next.
On the next page, scroll down to the Additional Properties section. Find the property called URL, and set its value to:
jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&emulateLocators=true
If your database is not on the same server as Glassfish, substitute your database server's host name for localhost above.
Click Add Property, and add a property called user with a value of the user name to connect to the database.
Click Add Property again, and add a property called password with a value of the password to connect to the database.
Click Finish.
You will now see a list of Connection Pools. To test your connection, click the LiferayPool and click the Ping button. If you get a Ping Succeeded message, everything has been set up correctly.
Click JDBC Resources. You will see a list of JDBC Resources by JNDI Name.
Click New.
Make the JNDI Name jdbc/LiferayPool and select the LiferayPool you created earlier.
Click OK.
Illustration 7: Glassfish Mail SessionUnder Resources, click JavaMail Sessions.
Click New.
Give the JavaMail Session a JNDI name of mail/MailSession, and fill out the rest of the form with the appropriate information for your mail server.
Click OK.
Click Application Server at the top of the tree hierarchy on the left.
Click JVM Settings -> JVM Options.
Click Add JVM Option, and enter the following:
-Dcom.sun.enterprise.server.ss.ASQuickStartup=false
Click Save.
Log out of the Administration Console and stop Glassfish.
Deploy Liferay by copying the liferay-portal-x.x.x.war file you downloaded in step 1 into the $GLASSFISH_HOME/domains/domain1/autodeploy directory.
Start Glassfish. When Liferay finishes starting, open http://localhost:8080 in your browser. You should see the default Liferay home page.
Jetty 5.1.1
Download and install Jetty 5.1.10-all.zip.
Note: Only this version of Jetty is supported by Liferay. Others may work but will not be covered in this documentation. From now on the home directory where you installed Jetty will be called $JETTY_HOME.
Download liferay-portal-x.x.x.war.
Download Liferay Portal Dependencies.
Create a $JETTY_HOME/lib/ext directory and copy unzip the dependencies in it.
Edit $JETTY_HOME/extra/etc/start-plus.config.
$(jetty.home)/lib/ext/
$(jetty.home)/lib/ext/*
Create a data source bound to jdbc/LiferayPool by editing $JETTY_HOME/etc/jetty.xml.
<Call name="addService">
<Arg>
<New class="org.mortbay.jetty.plus.JotmService">
<Set name="Name">TransactionMgr</Set>
<Call name="addDataSource">
<Arg>jdbc/LiferayPool</Arg>
<Arg>
<New class="org.enhydra.jdbc.standard.StandardXADataSource">
<Set name="DriverName">com.mysql.jdbc.Driver</Set>
<Set name="Url">jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8</Set>
<Set name="User"></Set>
<Set name="Password"></Set>
</New>
</Arg>
<Arg>
<New class="org.enhydra.jdbc.pool.StandardXAPoolDataSource">
<Arg type="Integer">4</Arg>
<Set name="MinSize">4</Set>
<Set name="MaxSize">15</Set>
</New>
</Arg>
</Call>
</New>
</Arg>
</Call>
Download mysql-connector-java-{$version}-bin.jar and copy to to $JETTY_HOME/lib/ext. This is the JDBC driver for MySQL. If you are using a different database, copy the appropriate driver.
Create a mail session bound to mail/MailSession by editing $JETTY_HOME/etc/jetty.xml:
<Call name="addService">
<Arg>
<New class="org.mortbay.jetty.plus.MailService">
<Set name="Name">MailService</Set>
<Set name="JNDI">mail/MailSession</Set>
<Put name="mail.smtp.host">localhost</Put>
</New>
</Arg>
</Call>
Create $JETTY_HOME/etc/jaas.config.
PortalRealm {
com.liferay.portal.kernel.security.jaas.PortalLoginModule required;
};
Create directory $JETTY_HOME/webapps/root and unpack liferay-portal-4.3.x.war into it.
Go to $JETTY_HOME/webapps/root/WEB-INF/lib and delete xercesImpl.jar and xml-apis.jar.
Copy $JETTY_HOME/webapps/root/WEB-INF/lib/commons-logging.jar to $JETTY_HOME/ext (overwriting existing one).
Create batch file.
Create a directory $JETTY_HOME/bin.
Create run.bat (Note, this is for Windows platform. For other platforms, configure accordingly).
@echo off
if "" == "%JAVA_HOME%" goto errorJavaHome
%JAVA_HOME%/bin/java -Xmx512m -Dfile.encoding=UTF8 -Duser.timezone=GMT -Djava.security.auth.login.config=../etc/jaas.config -DSTART=../extra/etc/start-plus.config -jar ../start.jar ../etc/jetty.xml
goto end
:errorJavaHome
echo JAVA_HOME not defined.
goto end
:end
Note: If you get a java.lang.OutOfMemoryError exception while starting up Jetty, give your JVM more memory by setting -Xmx512m.
Start Liferay by running run.bat. Open your browser to http://localhost:8080. You should see the default Liferay home page.
JBoss 4.03sp1/4.04/4.05 with Jetty 5.1.1
Download and install Jboss AS into your preferred directory. This directory will be referred to below as $JBOSS_HOME.
Download the latest version of the liferay-portal-x.x.x.war.
Create file $JBOSS_HOME/server/default/deploy/liferay-ds.xml with following content:
<?xml version="1.0"?>
<datasources>
<local-tx-datasource>
<jndi-name>jdbc/LiferayPool</jndi-name>
<connection-url>
jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8
</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name></user-name>
<password></password>
<min-pool-size>0</min-pool-size>
</local-tx-datasource>
</datasources>
Go to $JBOSS_HOME/server/default/lib/. Download mysql-connector-java-{$version}-bin.jar and copy to this directory. (This is the JDBC connector for MySQL, for other databases, go to appropriate website to download.)
Create a database for Liferay. For example:
create database lportal character set utf8;
Liferay will automatically create the tables and populate it the first time it starts.
Download Liferay's Portal Dependencies. Unzip to $JBOSS_HOME/server/default/lib.
Set mail properties by replacing the contents of $JBOSS_HOME/server/default/deploy/mail-service.xml with:
<?xml version="1.0"?>
<server>
<mbean code="org.jboss.mail.MailService" name="jboss:service=MailSession">
<attribute name="JNDIName">mail/MailSession</attribute>
<attribute name="User">nobody</attribute>
<attribute name="Password">password</attribute>
<attribute name="Configuration">
<configuration>
<property name="mail.store.protocol" value="imap" />
<property name="mail.transport.protocol" value="smtp" />
<property name="mail.imap.host" value="localhost" />
<property name="mail.pop3.host" value="localhost" />
<property name="mail.smtp.host" value="localhost" />
</configuration>
</attribute>
</mbean>
</server>
Configure JAAS. Edit $JBOSS_HOME/server/default/conf/login-config.xml and comment out the entire XML for policy other in lines 140-156.
<!--<application-policy name = "other">-->
...
<!--<authentication>
<login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule"
flag = "required" />
</authentication>
</application-policy>-->
Deploy liferay-portal-x.x.x.war.
1. Create directory $JBOSS_HOME/server/default/deploy/liferay-portal.war.
2. Unzip liferay-portal-x.x.x.war to directory.
3. Go to $JBOSS_HOME/server/default/deploy/liferay-portal.war/lib.
4. Move dom4j.jar, jaxen.jar to $JBOSS_HOME/lib.
5. Move commons-collections.jar to $JBOSS_HOME/server/default/lib.
6. Remove hibernate3.jar,jboss-hibernate.jar from $JBOSS_HOME/server/default/lib.
Edit $JBOSS_HOME/server/default/deploy/jbossjca-service.xml. Change Debug attribute in line 63 from true to false:
<attribute name="Debug">false</attribute>
In $JBOSS/server/default/deploy/jbossws14.sar/META-INF/jboss-service.xml, comment out the deployer service for JSE and EJB2.1 endpoints (lines 36-40 and lines 45-49).
<!--<mbean name="jboss.ws:service=WebServiceDeployerEJB21" code="org.jboss.ws.server.WebServiceDeployerEJB21">
<depends-list optional-attribute-name="Interceptables">
<depends-list-element>jboss.ejb:service=EJBDeployer</depends-list-element>
</depends-list>
</mbean>-->
lines 72-75
<!--<mbean name="jboss.ws:service=WebServiceDeployerNestedJSE" code="org.jboss.ws.server.WebServiceDeployerNestedJSE">
<depends optional-attribute-name="MainDeployer" proxy-type="attribute">jboss.system:service=MainDeployer</depends>
<depends>jboss.ws:service=WebServiceDeployerJSE</depends>
</mbean>-->
Edit $JBOSS_HOME/server/default/deploy/jms/jbossmq-destinations-service.xml. Clear out text between server tags:
<?xml version="1.0"?>
<server>
</server>
Start JBoss. Open your browser to http://localhost:8080. You should see the default Liferay home page.
JBoss 4.03sp1/4.04/4.05/ 4.2 with Tomcat
Download and install JBoss AS into your preferred directory. From now on, the directory where you installed JBoss will be referred to as $JBOSS_HOME.
Download liferay-portal-x.x.x.war.
Edit $JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/conf/web.xml. Replace the default servlet (lines 79-91) :
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
with:
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>input</param-name>
<param-value>4096</param-value>
</init-param>
<init-param>
<param-name>output</param-name>
<param-value>4096</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
Create $JBOSS_HOME/server/default/deploy/liferay-ds.xml with following content:
<datasources>
<local-tx-datasource>
<jndi-name>jdbc/LiferayPool</jndi-name>
<connection-url>
jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8
</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name></user-name>
<password></password>
<min-pool-size>0</min-pool-size>
</local-tx-datasource>
</datasources>
Go to $JBOSS_HOME/server/default/lib/, download mysql-connector-java-{$version}-bin.jar and copy to this directory. This is the JDBC driver for MySQL. If you are using a different database, copy the appropriate driver.
Download Liferay's Portal Dependencies. Unzip the downloaded archive into $JBOSS_HOME/server/default/lib.
Set mail properties by replacing the contents of $JBOSS_HOME/server/default/deploy/mail-service.xml with:
<?xml version="1.0"?>
<server>
<mbean code="org.jboss.mail.MailService" name="jboss:service=MailSession">
<attribute name="JNDIName">mail/MailSession</attribute>
<attribute name="User">nobody</attribute>
<attribute name="Password">password</attribute>
<attribute name="Configuration">
<configuration>
<property name="mail.store.protocol" value="imap" />
<property name="mail.transport.protocol" value="smtp" />
<property name="mail.imap.host" value="localhost" />
<property name="mail.pop3.host" value="localhost" />
<property name="mail.smtp.host" value="localhost" />
</configuration>
</attribute>
</mbean>
</server>
Configure JAAS. Edit $JBOSS_HOME/server/default/conf/login-config.xml and comment out the entire XML for policy other in lines 140-156.
<!--<application-policy name = "other">-->
...
<!--<authentication>
<login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule"
flag = "required" />
</authentication>
</application-policy>-->
Deploy liferay-portal-x.x.x.war.
Create new directory $JBOSS_HOME/server/default/deploy/liferay-portal.war.
Unzip liferay-portal-x.x.x.war to directory.
Go into $JBOSS_HOME/server/default/deploy/liferay-portal.war/lib.
Move dom4j.jar, jaxen.jar to $JBOSS_HOME/lib.
Move commons-collections.jar goes to $JBOSS_HOME/server/default/lib.
remove hibernate3.jar, jboss-hibernate.jar from $JBOSS_HOME/server/default/lib.
Edit $JBOSS_HOME/server/default/deploy/jbossjca-service.xml. Change the Debug attribute in line 63 from true to false:
<attribute name="Debug">false</attribute>
Edit $JBOSS_HOME/server/default/deploy/jms/jbossmq-destinations-service.xml. Clear out text between server tags:
<?xml version="1.0"?>
<server>
</server>
Start JBoss. Open your browser to http://localhost:8080. You should see the default Liferay home page.
Oracle Application Server (OC4J)
These instructions assume you have an installed OC4J container in a folder that will be referred to as $OC4J_HOME.
Unzip the dependencies archive (which is downloadable from Liferay's web site) into $OC4J_HOME/j2ee/home/applib. If you're using a database other than Oracle, put your JDBC driver here as well.
Shared Libraries
You will first need to create a Shared Library within OC4J that includes Apache's XML parser, which Liferay requires. You may either download this from http://xerces.apache.org or you can retrieve the files xercesImpl.jar and xml-apis.jar from the Liferay .war file.
Start OC4J. Go to http://<server>:8888/em.
Login in with the administrative credentials you used when you installed OC4J (user ID: oc4jadmin, password of your choosing).
Click Administration -> Shared Libraries.
Illustration 8: OC4J Shared LibrariesClick the Create button. For Shared Library Name, enter apache.xml and for Shared Library Version, enter the version number of Xerces that you downloaded. Click Next.
You will add two archives to this Shared Library: xercesImpl.jar and xml-apis.jar. Click the Add button and browse to where you expanded your download of Xerces. First, add xercesImpl.jar, then click the Add button again and add xml-apis.jar. Click Next.
Illustration 9: OC4J: Adding Archives to a Shared LibraryClick Finish. You'll be brought back to the Shared Library page.
Next, click the OC4J: home link in the top left of the page. This will bring you back to the home page of the OC4J console.
Database and Connection Pool
Click Administration -> JDBC Resources.
Illustration 10: OC4J: JDBC ResourcesUnder Connection Pools, click Create.
Select New Connection Pool and click Continue.
Give it a name, such as LiferayPool. If you are not using an Oracle database, you will have to specify the connection factory class manually. For example, the connection factory class for MySQL is com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource.
Fill out the JDBC URL to your database. You should have already configured your database and optionally run the Liferay create script.
Illustration 11: OC4J: Connection PoolClick Finish. Under Data Sources, click Create. Select Managed Data Source (default) and click Continue.
Give it a name (LiferayDataSource) and a JNDI location of jdbc/LiferayPool.
Illustration 12: OC4J: Liferay Data SourceSelect the Connection Pool you created in the previous step and then click Finish.
Click the Test Connection icon. If you are not using an Oracle database, change the test SQL to something like SELECT * from User_, and then click Test. You should get a message saying Connection to "LiferayDataSource" established successfully. If not, go back and check your settings.
Click the OC4J: home link in the top left of the page.
Installing Liferay
Click Applications.
Click Deploy. Leave the default selected under Archive, and click the Browse button. Browse to where your Liferay .war file is.
Illustration 13: OC4J: Uploading the Liferay .war fileWith the location of the Liferay .war file in the Archive Location field, click Next. Wait a while while OC4J uploads the Liferay .war file.
The next screen allows you to give the application a name and set its context root. Use Liferay for the name and /portal as the context root. Click Next.
Illustration 14: OC4J: Setting the Context RootOn the next screen, click the Configure Class Loading Link. You will see a list of all the Shared Libraries currently defined in the server. On this first page, click the apache.xml Shared Library that you created previously.
Illustration 15: OC4J: Configure Class LoadingClick the Next 10 link at the bottom right of the page.
At the bottom of the next page, there may be an oracle.xml Shared Library. It also may appear on another page. If you don't see it, keep clicking the Next 10 link until you find it. When you do find it, uncheck it.
Illustration 16: OC4J: Selecting XML class loadingClick the OK button at the top of this page. You will be brought back to the previous screen. Click the Deploy button at the top right of the screen. OC4J will then deploy Liferay.
Illustration 17: OC4J: Deploying LiferayClick the Return button at the top of the page.
Next, navigate to $OC4J_HOME/j2ee/home/applications/Liferay/liferay-portal-x.x.x/WEB-INF/classes. In this folder should be a file called portal-ext.properties. Open this file in a text editor. Add a directive for Portal Context, and give it a value of /portal, like so:
portal.ctx=/portal
Save this file.
Next, stop the OC4J instance to which you just installed Liferay. After it comes down, restart it. You should see Liferay start when the OC4J container starts.
You may see some messages stating that there are already some shared libraries on the class path, and that OC4J is going to use the ones it has rather than the ones that came with Liferay. You can remove these message either one of two ways:
Go to $OC4J_HOME/j2ee/home/applications/Liferay/liferay-portal-x.x.x/WEB-INF/lib and remove the .jar files that are listed in the messages. Then shut down and restart OC4J.
Create Shared Libraries for each one of the .jar files listed in the messages as you did above for the apache.xml .jars. Once you have done that, you will have to undeploy Liferay and then redeploy Liferay and select the Shared Libraries you have created for it during the deployment.
Once you have done one of the two steps above, OC4J should start normally without any messages other than the standard Liferay ones:
Starting OC4J from /usr/local/java/oc4j/j2ee/home ...
07/10/10 12:32:39 Loading code-source:/usr/local/java/oc4j/j2ee/home/applications/Liferay/liferay-portal-4.3.2/WEB-INF/lib/portal-impl.jar!/system.properties
07/10/10 12:32:40 Loading code-source:/usr/local/java/oc4j/j2ee/home/applications/Liferay/liferay-portal-4.3.2/WEB-INF/lib/portal-impl.jar!/portal.properties
07/10/10 12:32:40 Loading file:/usr/local/java/oc4j/j2ee/home/applications/Liferay/liferay-portal-4.3.2/WEB-INF/classes/portal-ext.properties
07/10/10 12:32:49 Starting Liferay Enterprise Portal 4.3.2 (Owen / Build 4302 / September 18, 2007)
12:32:53,180 INFO [com.liferay.portal.spring.hibernate.DynamicDialect] Determining dialect for MySQL 5
12:32:53,191 INFO [com.liferay.portal.spring.hibernate.DynamicDialect] Using dialect org.hibernate.dialect.MySQLDialect
12:32:58,248 INFO [com.liferay.portal.deploy.hot.PluginPackageHotDeployListener] Reading plugin package for the root context
12:32:58,941 INFO [com.liferay.portal.kernel.deploy.hot.HotDeployUtil] Initializing hot deploy manager 11099528
12:32:59,322 INFO [com.liferay.portal.kernel.util.ServerDetector] Detected server oc4j
12:32:59,616 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployDir] Auto deploy scanner started for /home/sezovr/liferay/deploy
07/10/10 12:33:02 Loading code-source:/usr/local/java/oc4j/j2ee/home/applications/Liferay/liferay-portal-4.3.2/WEB-INF/lib/portal-impl.jar!/portal.properties for 10092
07/10/10 12:33:02 Loading file:/usr/local/java/oc4j/j2ee/home/applications/Liferay/liferay-portal-4.3.2/WEB-INF/classes/portal-ext.properties for 10092
07/10/10 12:33:03 Oracle Containers for J2EE 10g (10.1.3.3.0) initialized
Resin 3.0.X / 3.1.X
Download and install Resin into your preferred directory. From now on, the directory where you installed Resin will be referred to as $RESIN_HOME.
Edit $RESIN_HOME/conf/resin.conf. Replace lines 60-64 with:
<class-loader>
<tree-loader path="${resin.home}/lib"/>
<tree-loader path="${server.root}/lib"/>
<compiling-loader path="${server.rootDir}/common/classes"/>
<library-loader path="${server.rootDir}/common/lib"/>
</class-loader>
And add the following:
<database>
<jndi-name>jdbc/LiferayPool</jndi-name>
<driver type="com.mysql.jdbc.Driver">
<url>jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8</url>
<user></user>
<password></password>
</driver>
<prepared-statement-cache-size>8</prepared-statement-cache-size>
<max-connections>20</max-connections>
<max-idle-time>30s</max-idle-time>
</database>
<resource jndi-name="mail/MailSession" type="javax.mail.Session">
<init>
<mail.store.protocol>imap</mail.store.protocol>
<mail.transport.protocol>smtp</mail.transport.protocol>
<mail.imap.host>localhost</mail.imap.host>
<mail.pop3.host>localhost</mail.pop3.host>
<mail.smtp.host>localhost</mail.smtp.host>
</init>
</resource>
<system-property
javax.xml.parsers.DocumentBuilderFactory="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"
/>
<system-property javax.xml.parsers.SAXParserFactory="org.apache.xerces.jaxp.SAXParserFactoryImpl" />
<system-property javax.xml.transform.TransformerFactory="org.apache.xalan.processor.TransformerFactoryImpl" />
<system-property org.xml.sax.driver="org.apache.xerces.parsers.SAXParser" />
Go to $RESIN_HOME and create new directory common/lib. Download mysql-connector-java-{$version}-bin .jar and copy to this directory. (This is the JDBC connector for MySQL, for other databases, go to appropriate website to download.)
Create a database for Liferay. For example:
create database lportal character set utf8;
Liferay will automatically create the tables and populate it the first time it starts.
Download the Liferay Portal Dependencies and unzip into $RESIN_HOME/common/lib.
Delete contents of $RESIN_HOME/webapps/ROOT.
Unzip liferay-portal-x.x.x.war to $RESIN_HOME/webapps/ROOT.
Download the sources of Liferay Portal and unzip them to a temporary directory:
Go to $LIFERAY_SOURCE/lib/development/ and copy activation.jar and mail.jar to $RESIN_HOME/common/lib. Copy saxpath.jar and xalan.jar to $RESIN_HOME/lib.
Go to $LIFERAY_SOURCE/lib/portal and copy xercesImpl.jar and xml-apis.jar to $RESIN_HOME/lib.
To start the server, open a command prompt, navigate to the $RESIN_HOME and type:
java -jar lib/resin.jar start
Open your browser to http://localhost:8080. You should see the default Liferay home page.
Tomcat 5.0.X/5.5.X
Download and install Tomcat 5.5.X into your preferred directory. From now on, the directory where you installed Tomcat will be referred to as $TOMCAT_HOME.
Note: For JDK 5 users: move $TOMCAT_HOME/webapps/ROOT/WEB-INF/lib/xercesImpl.jar to $TOMCAT_HOME/common/endorsed. JDK 1.4 is no longer supported in Liferay 5.x and above.
Create and edit $TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml to set up the portal web application.
<Context path="">
</Context>
Download liferay-portal-x.x.x.war.
Download Liferay's Portal Dependencies. Create a $TOMCAT_HOME/common/lib/ext directory and unzip the dependencies ZIP in there. If the files do not extract to this directory, make sure they are in the correct directory by moving them there.
Edit $TOMCAT_HOME/conf/catalina.properties:
common.loader=
${catalina.home}/common/classes,\
...\
${catalina.home}/common/lib/ext/*.jar
Make sure your database server is installed and is working. If it's installed in a different machine, make sure that it's accessible from the one where Liferay is being installed.
Configure data sources for your database. Make sure the JDBC driver for your database is accessible by Tomcat. Obtain the JDBC driver for your version of the database server. In the case of MySQL use mysql-connector-java-{$version}-bin.jar. Next, copy the JAR file to $TOMCAT_HOME/common/lib/ext.
Edit $TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml.
<Context...>
<Resource
name="jdbc/LiferayPool"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8"
username=""
password=""
maxActive="100"
maxIdle="30"
maxWait="10000"
/>
</Context>
Be sure to enter the user name and password to your database in the appropriate fields above.
Create a mail session bound to mail/MailSession. Edit $TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml and configure a mail session.
<Context...>
<Resource
name="mail/MailSession"
auth="Container"
type="javax.mail.Session"
mail.transport.protocol="smtp"
mail.smtp.host="localhost"
mail.store.protocol="imap"
mail.imap.host="localhost"
/>
</Context>
Configure JAAS. Edit $TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml and configure a security realm.
<Context...>
<Realm
className="org.apache.catalina.realm.JAASRealm"
appName="PortalRealm"
userClassNames="com.liferay.portal.security.jaas.PortalPrincipal"
roleClassNames="com.liferay.portal.security.jaas.PortalRole"
debug="99"
useContextClassLoader="false"
/>
</Context>
Create $TOMCAT_HOME/conf/jaas.config.
PortalRealm {
com.liferay.portal.kernel.security.jaas.PortalLoginModule required;
};
Edit $TOMCAT_HOME/bin/catalina.bat (on Windows) or $TOMCAT_HOME/bin/catalina.sh (on Linux / Mac / Unix) so that Tomcat can reference the login module.
rem ----- Execute...
set JAVA_OPTS=-Xms128m -Xmx512m -Dfile.encoding=UTF8 -Duser.timezone=GMT -Djava.security.auth.login.config=%CATALINA_HOME%/conf/jaas.config
Delete contents $TOMCAT_HOME/webapps/ROOT directory. This undeploys the default Tomcat home page.
Unpack liferay-portal-x.x.x.war to $TOMCAT_HOME/webapps/ROOT.
For supporting UTF-8 URI Encoding, edit $TOMCAT_HOME/conf/server.xml:
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"
URIEncoding="UTF-8"
/>
Run Tomcat, point browser to http://localhost:8080. You should see the default Liferay home page.
WebLogic8 sp5
Tip: WebLogic 8 does not support JDK 1.5. You will not be able to install Liferay 5.x and above on WebLogic 8. Liferay 4.x can be installed on WebLogic 8.
Installation
Put the necessary global .jars on the server class path. You can do this by creating a lib folder in your domain folder (i.e., bea/user_projects/domains/mydomain/lib) and then copying the following .jars into this directory:
portal-kernel.jar
portal-service.jar
portlet.jar
database driver (i.e., MySQL) .jar
xml-apis.jar and xercesImpl.jar (downloadable from http://xml.apache.org)
Inside your domain folder is a startWebLogic.sh (Unix) or startWebLogic.cmd (Windows) script. Open it and add the following (follow the syntax for your operating system):
# Set Liferay classpath
LIFERAY_WL_HOME="/<path to>/bea/user_projects/domains/mydomain/lib"
CLASSPATH="${WEBLOGIC_CLASSPATH}:${POINTBASE_CLASSPATH}:${JAVA_HOME}/jre/lib/rt.jar:${WL_HOME}/server/lib/webservices.jar:${LIFERAY_WL_HOME}/xercesImpl.jar:${LIFERAY_WL_HOME}/xml-apis.jar:${LIFERAY_WL_HOME}/portlet.jar:${LIFERAY_WL_HOME}/portal-kernel.jar:${LIFERAY_WL_HOME}/portal-service.jar:${LIFERAY_WL_HOME}/mysql-connector-java-5.0.5-bin.jar"
Start WebLogic.
Open the WebLogic Server Administration Console.
Under JDBC, click Connection Pools.
Click Configure a New Connection Pool.
Illustration 18: Connecting to a database in WebLogic 8Select MySQL from the list. Select Other for Driver Type.
For the driver class name, use com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource.
For the database URL, use:
jdbc:mysql://<your server>/<your db name>?useUnicode=true&characterEncoding=UTF-8
Use the user name and password you have set up for your database.
Click Test Connection, and after the connection is successful, click Create and Deploy.
Under JDBC, click Data Sources.
Click Configure a New JDBC Data Source.
Enter the name of the data source. The JNDI name should be jdbc/LiferayPool.
You will be presented with the Connect to Connection Pool screen. Select the Connection Pool you created earlier from the drop down, and click Continue.
Select the server to which you want to target this data source, and then click the Create button.
Under Deployments, click Web Application Modules.
Illustration 19: WebLogic 8 Data SourceClick Deploy a New Web Application Module.
Select the Upload Your File(s) link.
Browse to where your Liferay .war file (for WebLogic 8.1, use the Servlet 2.3 .war) is and click the Upload button.
Illustration 20: Uploading the Liferay .war to WebLogic 8Select the Liferay .war you just uploaded and click the Target Module button.
Click Deploy.
Stop WebLogic and restart it. Point your browser to http://localhost:7001. You should see the default Liferay home page.
Troubleshooting
Weblogic 8 doesn't support JDK1.5 and servlet2.4. Make sure you have deployed the servlet 2.3 version of Liferay.
If a SocialBookmarkTag exception is thrown, add util-taglib.jar in your liferay-portal-4.x.x war to your domain's lib folder and reference it in the startup script you edited above.
If you can't see the home page, check your weblogic.xml for Liferay and make sure the following is set:
<context-root>/</context-root>
WebLogic 9 / 10
These instructions assume that you have already configured a domain and server, and that you have access to the WebLogic console.
Dependency Jars
Navigate to the folder which corresponds to the domain to which you will be installing Liferay. Inside this folder is a lib folder. Unzip the Liferay dependencies archive to this folder.
Copy the JDBC driver for your database to this folder as well.
You will also need the xercesImpl.jar or you will get SAX parsing errors after you deploy Liferay. You may download this from http://xerces.apache.org. Copy the xercesImpl.jar file into this directory.
Installing Liferay
Illustration 21: WebLogic: Data SourcesBrowse to your WebLogic Console. Click the Lock & Edit button above the Domain Structure tree on the left side of the page.
From the Domain Structure tree on the left, select Data Sources. Then click the New button on the right side of the screen.
Give the Data Source a name, such as LiferayDataSource.
Define the JNDI name as jdbc/LiferayPool.
Select your Database Type and the Driver class, and then click the Next button.
Accept the defaults on the next screen by clicking Next.
On the next screen, put in your Database Name, Host Name, Database User Name, and Password. If you have been following the defaults we have been using so far, you would use lportal, localhost, root, and no password as the values. Click Next.
The next screen allows you to test your database configuration. Click the Test Connection button. If the test succeeds, you have configured your database correctly. Check off the server you want to deploy this Data Source to (AdminServer is the default). Click Finish.
Click the Activate Changes button on the left, above the Domain Structure tree.
In the Domain Structure tree, select Mail Sessions. Then click the Lock & Edit button again to enable modifying these settings.
Click the New button which is now enabled on the right side of the screen.
Give the Mail Session a name, such as LiferayMail.
Select your new LiferayMail session from the list by clicking on it.
On the screen that appears, define the JNDI name as mail/MailSession. Click the Save button.
Click the Targets tab. Check off the server you want to deploy this Data Source to (AdminServer is the default).
Click the Activate Changes button on the left side of the screen, above the Domain Structure tree.
Click the Deployments option in the Domain Structure tree on the left side of the screen.
Illustration 22: WebLogic: Mail SessionsClick the Lock & Edit button above the Domain Structure tree.
Click the Install button on the right side of the screen.
Click the Upload your file(s) link.
Browse to where you have stored the Liferay .war file, select it, and then click Next.
Select the Liferay .war file from the list and click Next.
Leave Install this deployment as an application selected and click Next.
Give the application a name (the default name is fine). Leave the other defaults selected and then click Finish.
WebLogic will now deploy Liferay. When it is finished, a summary screen is displayed. Click the Activate Changes link on the left above the Domain Structure tree.
In the Deployments screen, select the Liferay application and click the Start button. Select Servicing All Requests in the pop up.
Click Yes to continue on the next screen.
Liferay will start. You will be able to get to it by browsing to http://<server name>:7001. If your browser is running on the same machine upon which you have installed Liferay, the URL is http://localhost:7001.
WebSphere 6.0.X.X
Tip: WebSphere 6.0 does not support JDK 1.5. You will not be able to install Liferay 5.x and above on WebSphere 6.0. Liferay 4.x can be installed on WebSphere 6.0.
Installation
Tip: Throughout this installation and configuration process, WebSphere will prompt you to Click Save to apply changes to Master Configuration. Do so intermittently to save your changes.
Download Liferay Portal WAR file.
Download and extract these Liferay jars to websphere/appserver/lib/ext.
Dependency libraries (Liferay Portal Dependencies)
liferay-portal-jaas.jar (Liferay Portal Enterprise JAAS Libraries from Sourceforge)
mysql-connector-java-x.x.x-bin.jar (MySQL)
Set Up Database Service
Start WebSphere.
Open Administrative Console and login.
Click Resources, click JDBC Providers.
Illustration 23: WebSphere JDBC Providers
Click Next.
For name, enter name of JDBC provider, e.g. liferayjdbc.
Clear any text in class path.
For Implementation class name enter
com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
Illustration 24: WebSphere Liferay JDBC Provider
Click OK.
Click Data sources under Additional Properties.
Click New.
Enter a name: liferaydatabasesource.
Enter JNDI: jdbc/LiferayPool.
Everything else should stay at the default values.
Click OK.
Illustration 25: Liferay Database Resource on WebSphere
Under Additional Properties, click Custom properties.
Click New.
Create three custom properties by entering Name, Value and clicking OK for each row in the following table:
Name
Value
1. user
root
2. serverName
localhost
3. databaseName
lportal
When done correctly, custom properties should look like this:
Illustration 26: All of the Liferay Custom Properties
Click Data Sources -> Test Connection to test.
Mail Configuration
Click Resources -> Mail Providers.
Click Built-in Mail Provider.
Click Mail Sessions.
Click New.
Name: liferaymail
JNDI name: mail/MailSession
Leave the other fields as they are and click OK.
Click Security.
Click Global Security.
Select Enable Global Security.
Deselect Enforce Java 2 Security.
In Active User Registry, select Custom User Registry.
Click Apply to go to Custom user registry page.
Illustration 27: WebSphere Global Security Settings
Enter system for server user ID.
Enter password for server user password.
Enter Custom registry class name com.liferay.portal.security.jaas.ext.websphere.PortalUserRegistry.
Click Apply.
Illustration 28: WebSphere Custom User Registry
Insert user name/password into database:
Open a MySQL console.
Log in and select the Liferay database by typing use lportal;
Enter the following SQL command:
Insert into User_ (companyId, userId, password_) values ('system', 'system', 'password');
Illustration 29: Insert Custom User Manually into DatabaseInstall Liferay
Click Applications -> Install New Application.
Browse for liferay-portal-x.x.x.war.
Enter context root /.
Illustration 30: Installing the Liferay .war file on WebSphere
Click Next
Select Generate Default Bindings -> Override default bindings -> Use default virtual host name for web modules.
Illustration 31: Binding Liferay
Click Next. Click Continue. For Steps 1 to 4, click Next to apply defaults.
Illustration 32: The WebSphere Install wizard
In Step 5, check all authenticated.
Illustration 33: Mapping Security Roles in WebSphere
Click Next.
Illustration 34: Completing the installation wizard
Click Finish.
Wait for installation process.
Illustration 35: Liferay installed successfully on WebSphere
Save this configuration to master configuration by clicking on System administration and Save Changes to Master Repository.
Start Liferay Portal
Click Applications.
Click Enterprise Applications.
Illustration 36: Starting Liferay on WebSphere
Uninstall DefaultApplication, PlantsByWebSphere and SamplesGallery.
Select liferay-portal.war and click Start.
Open up browser and point to http://localhost:9080. You should see the default Liferay home page.
If you are running Windows, edit your Stop the Server shortcut to set the user id and password. If you don't do this, you will not be able to stop the server after you restart WebSphere:
"C:\Program Files\WebSphere\AppServer\bin\stopServer.bat" server1 -user system -password password
Stop WebSphere and restart it. Login on with system for user name and password for password.
WebSphere 6.1
Tip: Throughout this installation and configuration process, WebSphere will prompt you to Click Save to apply changes to Master Configuration. Do so intermittently to save your changes.
Installation
Download the Liferay Portal WAR file.
Download and extract these Liferay jars to websphere/appserver/lib/ext.
Dependency libraries (Liferay Portal Dependencies)
Currently you also need to copy portlet.jar from the Liferay Dependencies archive and icu4j.jar from the Liferay WAR file into WebSphere/AppServer/java/lib/ext, as WebSphere already contains older versions of these .jar files which must be overridden at the highest level of the class path. This issue may be fixed in future releases; check the Liferay Wiki for updates to this issue.
mysql-connector-java-x.x.x-bin.jar (MySQL)
Set Up Database Service
Start WebSphere.
Open Administrative Console and login.
Click Resources, click JDBC Providers.
Illustration 37: WebSphere 6.1 JDBC Providers
Click New.
For name, enter name of JDBC provider, e.g. MySQL Jdbc Provider.
For Implementation class name, enter:
com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
Illustration 38: WebSphere 6.1 New JDBC ProviderClick Next.
Illustration 39: Clear out anything in the class path. Clear any text in class path. You already copied the necessary .jars to a location on the server's class path.
Click Next.
Illustration 40: JDBC Provider summary screenClick Finish.
Click Data Sources under Additional Properties.
Click New.
Enter a name: liferaydatabasesource.
Enter JNDI: jdbc/LiferayPool.
Everything else should stay at the default values.
Illustration 41: Liferay data source on WebSphere 6.1Click Next.
Under Additional Properties, click Custom Properties.
Click New.
Create three custom properties by entering Name, Value and clicking OK for each row in the following table.
Name
Value
1. user
root
2. serverName
localhost
3. databaseName
lportal
Illustration 42: WebSphere 6.1 Custom Properties Entry
When done correctly, custom properties should look like this:
Illustration 43: Liferay Custom Properties
Click Data Sources -> Test Connection to test.
Mail Configuration
Click Resources -> Mail Providers.
Click Built-in Mail Provider.
Click Mail Sessions.
Click New.
Name: liferaymail
JNDI Name: mail/MailSession
Illustration 44: Creating a Mail Session on WebSphere 6.1
Click OK.
Click Security.
Click Secure administration, applications, and infrastructure.
Select Enable application security.
Deselect Use Java 2 security to restrict application access to local resources.
Install Liferay
Click Applications -> Install new applications.
Browse for liferay-portal-x.x.x.war.
Illustration 45: Installing the Liferay .war file on WebSphere 6.1Enter context root /.
Illustration 46: Select the installation optionsClick Next. For Steps 1 to 3, click Next to apply defaults.
Choose the Mail Session and Data Source, and then click Next
Illustration 47: Select the virtual hostSpecify the virtual host upon which you want Liferay to run.
At the Summary Screen, click Finish.
Illustration 48: WebSphere 6.1 installation processWait for the installation process to complete.
Save this configuration to master configuration by clicking on System administration and Save Changes to Master Repository.
Start Liferay Portal
Applications.
Click Enterprise Applications.
Illustration 49: Starting Liferay on WebSphere 6.1
Uninstall DefaultApplication, PlantsByWebSphere and SamplesGallery.
Select liferay-portal.war, click Start.
Open up browser and point to http://localhost:9080. The default Liferay home page will be displayed.
Making Liferay Coexist with Other Java EE Applications
Liferay Portal by default is configured to sit at the root (i.e., /) of your application server. Dedicating your application server to running only Liferay Portal is a good practice, allowing for separation between your portal environment and your web application environment. If, however, you want Liferay to share space on an application server with other applications, there is no reason why you cannot do that. In this instance, you may not want to make Liferay the default application in the root context of the server.
There are two steps to modifying this behavior:
Deploy Liferay in a context other than root (for example /portal).
Modify the portal-ext.properties file to tell Liferay the context to which it has been deployed.
The order in which you take these steps depends on your application server. If your application server deploys Liferay in such a manner that you can browse its directory structure and modify files, then you would make this change in the order above (i.e., after deploying Liferay, but before starting it). If your application server does not deploy Liferay in this way, then you will have to modify the portal-ext.properties file inside the Liferay .war itself. You would extract the file from the .war file, modify it, and then put it back in the .war file. Then deploy the modified Liferay .war file to the server in the proper context.
To change the file, open it in a text editor. Place the portal.ctx property at the top of the file:
portal.ctx=/
This default setting defines Liferay Portal as the application that sits at the root context. If you change it to something else, say /portal, for example, you can then deploy Liferay in that context and it will live there instead of at the root context.
A full discussion of the portal-ext.properties file appears in Chapter 4.