Setting Up Liferay Portal on Websphere 8

This article documents how to deploy Liferay Portal on WebSphere 8.


Before making any changes to the WebSphere application server, stop the server first. Failure to do so can cause errors.

The latest versions of Liferay Portal—from 6.1 onward—allows hot deploys in WebSphere. To configure this feature correctly, make sure that the auto.deploy.dest.dir is a separate directory from the liferay.homedirectory. In other words, do not set liferay.home as C:/home, and likewise, do not set auto.deploy.dest.dir as C:/home/deploy; doing so will cause the deploy folder for both liferay.home and auto.deploy.dest.dir to be identical and will cause problems with plugin deployment.

Place the inside the Liferay.war file before deployment, and obtain the required .jar and .war files.

The following .jar files are required.

  • hsql.jar
  • portal-service.jar
  • portlet.jar

In addition, the following .jar files are also required.

  • jtds.jar
  • mysql.jar
  • persistance.jar
  • postgresql.jar
  • servlet-api.jar
  • activation.jar (only with mail integration)
  • mail.jar (only with mail integration)

Setting up Liferay on WebSphere

  1. Place the following .jar files in this location: C:\Program Files\IBM\WebSphere\AppServer\lib\ext
    • hsql.jar
    • jtds.jar
    • mysql.jar
    • persistance.jar
    • portal-service.jar
    • postgresql.jar
  2. Place the following .jar files in this location: C:\Program Files\IBM\WebSphere\AppServer\java\jre\lib\ext
    • servlet-api.jar
    • portlet.jar
  3. Optional, and only for use when specifically requiring mail integration: C:\Program Files\IBM\WebSphere\AppServer\java\jre\lib\ext
    • activation.jar
    • mail.jar
  4. Start the WebSphere 8 Server by navigating to Start > Programs > IBM WebSphere > Application Server V8.0 > Profiles > AppSrv01, and then click Start the Server.
  5. Start the Administrative Console by going to Start > Programs > IBM WebSphere > Application Server V8.0 > Profiles > AppSrv01, and then click Administrative Console.
  6. Go to Applications > Application Types > WebSphere Enterprise Application. There are several applications already running. Check all applications and click Stop. Uninstall the default application because this will conflict with Liferay Portal's default context root settings.

WebSphere Optimization (Essential for Proper Function of Liferay in WebSphere)

Before starting Liferay Portal, the user must optimize WebSphere by changing several settings in the Java and Dynamic Cache Service. Changing these settings will allow Liferay Portal to function properly without slowing down, crashing or losing essential features, like the dockbar or CKEditor.

  1. Go to Application Servers > Server1 > Java and Process Management > Process definition > Java Virtual Machine
    1. Set Initial Heap Size = 256MB
    2. Set Maxium Heap Size = 1024MB
    3. Verbose garbage collection is set to true
    4. Set Generic JVM argument: -Xk22000 -Xp64k,16k
  2. Go to Application Servers > server1 > Container Services >Dynamic Cache Service
    1. Set Cache Size = 3000
    2. Set Default priority = 3
  3. Go to Application Servers > server1 > Web container > Custom properties
    1. Name =
    2. Value = true
  4. Stop the server then restart it before starting the portal.

Configuring the Portal to Connect Using JNDI

By default, Liferay Portal's MySQL connections in the is a JDBC connection. However, users can also connect to a database through JNDI connections instead of purely JDBC. Using the JNDI, users have the options to set as PoolDataSource or XADataSource.

JNDI PoolDataSource Connection Steps

  1. Click Resources from the left drop-down menu.
  2. Click JDBC Providers
  3. Select the third option that has both the node and the server from the Scope drop-down menu.
  4. Click the New... button.
  5. Select the following:
    1. Database Type: User-defined
    2. Implementation class name: com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
    3. Name: MySQL Provider
    4. Description: MySQL JNDI connection
  6. Click Next
  7. Delete the value in the class path. This is because we will be using our own mysql.jar. Ensure that the mysql.jar file is already in its proper place in the WebSphere directory before starting the server.
  8. Click Next
  9. Click the Finish button
  10. Click Save
  11. Assert that MySQL Provider now displays as a new JDBC provider.
  12. Click the newly created MySQL Provider.
  13. Click Data Sources under Additional Properties.
  14. Click the New button.
  15. Enter liferaydatabasesource in the Data source name field.
  16. Enter java_liferay:jdbc/LiferayPool in the JNDI name field.
  17. Click Next for the next screens and leave the default values until the Summary page.
  18. Click Finish
  19. Click Save
  20. Assert that liferaydatabasesource now displays as a new data source.
  21. Click the liferaydatabasesource link.
  22. Click Custom Properties under Additional Properties
  23. Click the Show filter function. Search for the following then input the corresponding values:
    1. Filter: Name. Search terms"
    2. user - Value: root (blank for anonymous user)
    3. serverName - Value: Database IP Address or (localhost)
    4. databaseName - Value: database name
  24. Click OK
  25. Click Save

In the, add the following:

plugin.notifications.enabled=false liferay.home= auto.deploy.dest.dir=

This is in place of the default JDBC connections. It must be one or the other.

For JNDI and XA Datasource, there are several key differences. Notably, use the mysql-connector-java-5.1.25-bin.jar instead of the mysql.jar available from the source files. Second, specify the XA connection in the Implementation class name field.

  1. Click Resources from the left drop down menu.
  2. Click JDBC Providers
  3. Select the third option that has both the node and the server from the Scope drop down.
  4. Click the New... button.
  5. Select the following:
    1. Database Type: User-defined
    2. Implementation class name: com.mysql.jdbc.jdbc2.optional.MysqlXADataSource.
    3. Name: MySQL Provider
    4. Description: MySQL JNDI connection
  6. Click Next.
  7. Delete the value in the class path. This is because we will be using our own mysql-connector-java-5.1.25-bin.jar. Ensure that the mysql-connector-java-5.1.25-bin.jar file is already in its proper place in the WebSphere directory before starting the server.
  8. Click Next
  9. Click the Finish button.

Continue with the same steps in the JNDI section after this point.

Setting up the Equifax Certificate for Mail Integration (Optional, but required when testing mail integration features using Gmail)

By default, WebSphere does not trust the Equifax Secure Certificate Authority that is used by the domain Thus, the certificate must be added to trust certificates in order for proper function of mail integration using Gmail.

  1. Download the certificate from the following link:
  2. In the Admin Console, go to SSL certificate and key management, then go to Manage endpoint security configurations.
    1. Select a node (either one should work).
    2. Go to Key stores and certificates.
    3. Go to NodeDefaultTrustStore.
    4. Go to Signer certificates.
  3. Click Add and type equifax as the alias, then enter in the path to the .cer file.
    1. Apply and save.
    2. The Equifax certificate will be added.
  4. Make sure that the activation.jar and mail.jar files are added to the C:\Program Files\IBM\WebSphere\AppServer\java\jre\lib\ext directory as mentioned above.

Installing and Starting Liferay Portal

Once all the necessary steps have been taken, the application server is now ready to deploy Liferay Portal. Install the liferay.war file as a new application and follow the prompts. Save to the master configuration and start Liferay Portal. The portal will start on port 9080.

1 人中有 0 人觉得有帮助