IBM ® WebSphere ® is a trademark of International Business Machines Corporation, registered in many jurisdictions worldwide.
For Liferay DXP to work correctly, WebSphere 8.5.5 Fix Pack 11 (or later) must be installed. You can find more information about this fix pack here.
Please also note that Liferay DXP doesn’t support the WebSphere Application Liberty Profile.
You should also read the following articles to familiarize yourself with Liferay DXP’s general installation steps:
Note that the
Liferay Home folder
is important to the operation of Liferay DXP. In Liferay Home, Liferay DXP creates
certain files and folders that it needs to run. On WebSphere, Liferay Home is
Before proceeding, you must download these Additional Files:
- Liferay DXP WAR file
- Dependencies ZIP file
- OSGi Dependencies ZIP file
Without any further ado, get ready to install Liferay DXP in WebSphere!
When the application server binaries have been installed, start the Profile Management Tool to create a profile appropriate for Liferay DXP.
Click Create…, choose Application Server, and then click Next.
Click the Advanced profile creation option and then click Next. Why Advanced? You can specify your own values for settings such as the location of the profile and names of the profile, node and host. You can assign your own ports. You can optionally choose whether to deploy the administrative console and sample application and also add web-server definitions if you wish. Web server definitions are used with IBM HTTP Server. See the WebSphere documentation for more information about these options.
Check the box Deploy the administrative console. This gives you a web-based UI for working with your application server. Skip the default applications. You’d only install these on a development machine. Click Next.
Set the profile name and location. Ensure you specify a performance tuning setting other than Development, since you’re installing a production server. See the WebSphere documentation for more information about performance tuning settings. Click Next.
Choose node, server, and host names for your server. These will be specific to your environment. Click Next.
Administrative security in WebSphere is a way to restrict who has access to the administrative tools. You may want to have it enabled in your environment so that a user name and password are required to administer the WebSphere server. See WebSphere’s documentation for more information. Click Next.
Each profile needs a security certificate, which comes next in the wizard. If you don’t have certificates already, choose the option to generate a personal certificate and a signing certificate and click Next.
Once the certificates are generated, set a password for your keystore. Click Next.
Now you can customize the ports this server profile uses. Be sure to choose ports that are open on your machine. When choosing ports, the wizard detects existing WebSphere installations and if it finds activity, it increments ports by one.
Choose whether you want this profile started when the machine starts. Click Next.
WebSphere ships with IBM HTTP Server, which is a re-branded version of Apache. Choose whether you want a web server definition, so that this JVM receives requests forwarded from the HTTP server. See WebSphere’s documentation for details on this. When finished, click Next.
The wizard then shows you a summary of what you selected, enabling you to keep your choices or go back and change something. When you’re satisfied, click Next.
WebSphere then creates your profile and finishes with a message telling you the profile was created successfully. Awesome! Your profile is complete. Now there are a few things you need to configure in your application server.
In this version of WebSphere, servlet filters are not initialized on web
application startup, but rather, on first access. This can cause problems when
deploying certain apps to Liferay DXP. To configure servlet filters to initialize
on application startup (i.e., deployment), you need to set the following
webcontainer custom properties in your WebSphere application server:
com.ibm.ws.webcontainer.initFilterBeforeInitServlet = true
com.ibm.ws.webcontainer.invokeFilterInitAtStartup = true
webcontainer custom properties in the WebSphere application server,
follow the instructions
here in WebSphere’s documentation.
Next, in the WebSphere profile you created for Liferay DXP, you must set an argument that supports Liferay DXP’s Java memory requirements. You’ll modify this file:
maximumHeapSize="2048" inside the
jvmEntries tag. For example:
<jvmEntries xmi:id="JavaVirtualMachine_1183122130078" ... maximumHeapSize="2048">
Administrators can set the UTF-8 and GMT time zone properties in the
server.xml file. This is required or else special characters will not be
parsed correctly. Add the following inside the
<jvmEntries xmi:id="JavaVirtualMachine_1183122130078" ...genericJvmArguments="-Dfile.encoding=UTF-8 -Duser.timezone=GMT">
Alternately, you can set the UTF-8 and GMT properties from the WebSphere Admin Console. (See below.)
In the same profile, you should delete a problematic
that can cause Liferay DXP startup errors. Note that this is just a default
setting; once Liferay DXP is installed, you should tune it appropriately based on
secureSessionCookie tag containing
If this tag is not removed, an error similar to the one here may occur:
WSVR0501E: Error creating component com.ibm.ws.runtime.component.CompositionUnitMgrImpl@d74fa901
com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: SRVE8111E: The application, LiferayEAR, is trying to modify a cookie which matches a pattern in the restricted programmatic session cookies list [domain=*, name=JSESSIONID, path=/].
You must now install Liferay DXP’s dependencies. Recall that earlier you downloaded two ZIP files containing these dependencies. Install their contents now:
liferay-dxp-digital-enterprise-dependencies-[version].zip: Unzip this file and place its contents in your WebSphere application server’s
[Install Location]/WebSphere/AppServer/lib/extfolder. If you have a JDBC database driver
JAR, copy it to this location as well.
liferay-dxp-digital-enterprise-osgi-[version].zip: Unzip this file and place its contents in the
[Liferay Home]/osgifolder (create this folder if it doesn’t exist). This is typically
Before starting the server, verify that all the following jars have been copied
to the correct folders. Optional jars are available (italics) and are used to
optimize Liferay performance which must be added to this folder. Required jars
in bold are from the
liferay-digital-enterprise-dependencies-7.0-ga1 zip. The
following files should be present within the
lib/ext (WebSphere Application)
- A JDBC database jar (e.g. MySQL, MariaDB, IBM DB2, Postgres)
The following folders should be present within the
Once you’ve installed these dependencies, start the server profile you created for Liferay DXP. Once it starts, you’re ready to configure your database.
If you want WebSphere to manage the database connections, follow the instructions below. Note this is not necessary if you’re planning on using Liferay DXP’s standard database configuration; in that case, skip this section. You’ll set your database information in Liferay DXP’s setup wizard after the install.
![Figure 3: WebSphere JDBC providers](../../images/websphere-jdbc-providers.png)
Open the Administrative Console and log in.
Click Resources → JDBC Providers.
Select a scope and then click New.
Select your database type, provider type, and implementation type. If you select a predefined database, the wizard fills in the name and description fields for you. If the database you want to use isn’t listed, select User-defined from the Database type field and then fill in the Implementation Class Name. For example, if you are using MySQL, select Database type → User-defined, and then enter
com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSourcein Implementation Class Name. Click Next when you are finished.
Clear any text in the classpath settings. You already copied the necessary JARs to a location on the server’s classpath. Click Next.
Review your settings and click Finish. The final configuration should look like this:
Click your new provider configuration when it appears in the table, and then click Data Sources under Additional Properties. Click New.
Enter liferaydatabasesource in the Data source name field and
jdbc/LiferayPoolin the JNDI name field. Click Next.
Click Next in the remaining screens of the wizard to accept the default values. Then review your changes and click Finish.
Click the data source when it appears in the table and then click Custom Properties. Now click the Show Filter Function button. This is the second from last of the small icons under the New and Delete buttons.
Type user into the search terms and click Go.
Select the user property and give it the value of the user name to your database. Click OK and save to master configuration.
Do another filter search for the url property. Give this property a value that points to your database. For example, a MySQL URL would look like this:
Click OK and save to master configuration.
Do another filter search for the password property. Enter the password for the user ID you added earlier as the value for this property. Click OK and save to master configuration.
Go back to the data source page by clicking it in the breadcrumb trail. Click the Test Connection button. It should connect successfully.
Once you’ve set up your database, you can set up your mail session.
If you want WebSphere to manage your mail sessions, use the following procedure. If you want to use Liferay DXP’s built-in mail sessions, you can skip this section.
Click Resources → Mail → Mail Providers.
Click the Built-In Mail Provider for your node and server.
Click Mail Sessions and then click the New button.
Give your mail session a name of liferaymail and a JNDI name of
mail/MailSession. Fill in the correct information for your mail server in the sections Outgoing Mail Properties and Incoming Mail Properties. Click OK and then save to the master configuration.
Click your mail session when it appears in the table and select Custom Properties under the Additional Properties section. Set any other JavaMail properties required by your mail server, such as the protocol, ports, whether to use SSL, and so on.
Click Security → Global Security and de-select Use Java 2 security to restrict application access to local resources if it is selected. Click Apply.
Note that you may also need to retrieve a SSL certificate from your mail server and add it to WebSphere’s trust store. See WebSphere’s documentation for instructions on this.
To validate that the mail session has been configured correctly, there are a number of ways to test this once the WAR has been deployed, the server has started, and the user has signed in as the system administrator. One quick way to validate is to create a new user with a valid email account. The newly created user should receive an email notification. The logs should display that the SMTP server has been pinged with the correct port number listed.
WebSphere 220.127.116.11 restricts cookies to HTTPS sessions by default. If you’re using HTTP instead, this prevents users from signing in to Liferay DXP and displays the following error in the console:
20:07:14,021 WARN [WebContainer : 1][SecurityPortletContainerWrapper:341]
User 0 is not allowed to access URL http://localhost:9081/web/guest/home and
This occurs because Liferay DXP can’t use the HTTPS cookie when you use HTTP. The end result is that new sessions are created on each page refresh. Follow these steps to resolve this issue in WebSphere:
Click Application Servers → server1 → Session Management → Enable Cookies
De-select Restrict cookies to HTTPS sessions
If you did not add the
-Dfile.encoding=UTF-8 property in the
can do so in the Administrative Console.
Click Application Servers → server1 → Process definition.
Click Java Virtual Machine under Additional Properties.
-Dfile.encoding=UTF-8in the Generic JVM arguments field.
Click Apply and then Save to master configuration.
Once the changes have been saved, Liferay DXP can parse special characters if there is localized content.
Now you’re ready to deploy Liferay DXP!
In WebSphere’s administrative console, click Applications → New Application → New Enterprise Application.
Browse to the Liferay DXP
.warfile, select it, and click Next.
Leave Fast Path selected and click Next. Ensure that Distribute Application has been checked and click Next again.
Choose the WebSphere runtimes and/or clusters where you want Liferay DXP deployed. Click Next.
Select the virtual host to deploy Liferay DXP on and click Next.
Map Liferay DXP to the root context (/) and click Next.
Select the metadata-complete attribute setting that you want to use and click Next.
Ensure that you have made all the correct choices and click Finish. When Liferay DXP has installed, click Save to Master Configuration.
You’ve now installed Liferay DXP!
Liferay DXP requires that its JSPs are compiled on Java 8. To ensure that
WebSphere does this, shut down WebSphere after you’ve deployed the Liferay DXP
.war file. Navigate to the
WEB_INF folder and add the following setting to
ibm-web-ext.xml or in most cases the
<jsp-attribute name="jdkSourceLevel" value="18" />
The exact path to the
ibm-web-ext.xmi file depends on your WebSphere
installation location and Liferay DXP version, but here’s an example:
Note that the Liferay DXP
.war comes pre-packaged with the
file; this format is functionally the same as
.xml and WebSphere recognizes both
formats. For more general information on how WebSphere compiles JSPs see IBM’s
official documentation for
WebSphere Application Server 8.5.5.x.
Now restart WebSphere.
When you are ready to start using apps from Liferay Marketplace, you must enable Liferay’s Portal Access Control Lists (PACL) to enforce security policies on Marketplace applications. To do so, you must enable Java Security on your WebSphere server and specify a security policy to grant Liferay DXP access to your server.
In WebSphere’s administrative console, go to Security → Global Security. Check the box to enable Java 2 security, and click Apply. Save to the master configuration.
Now you must configure the security policy for the IBM JRE that WebSphere runs on. With your WebSphere server shut down, open the following security policy file:
Replace this file’s contents with the following configuration:
This configuration opens all permissions. As best practices, opening all permissions when starting Liferay Digital Enterprise 7.0 for the first time allows for the creation of all required processes. Users can change security settings later and restrict which plugins have access. (Users have the options of using either the application server’s security policies or Liferay DXP’s.) See this article concerning a Known Issues when generating PACL.
Once this permission has been set, users can start Liferay DXP.
If you plan to use Liferay DXP’s setup wizard, skip to the next step. If you wish to use WebSphere’s data source and mail session, create a file called
portal-ext.propertiesin your Liferay Home folder. Place the following configuration in the file:
jdbc.default.jndi.name=jdbc/LiferayPool mail.session.jndi.name=mail/MailSession setup.wizard.enabled=false
In the WebSphere administrative console, navigate to Enterprise Applications, select the Liferay DXP application, and click Start. While Liferay DXP is starting, WebSphere displays a spinny little graphic. Don’t watch it too closely, or you might get hypnotized.
In Liferay DXP’s setup wizard, select and configure your database type. Click Finish when you’re done. Liferay DXP then creates the tables it needs in the database.
Congratulations! You’ve installed Liferay DXP on WebSphere!