Installing on WebLogic
If you are using WebLogic as your application server, it is highly recommended to install DXP to a WebLogic Managed server. A managed server can start and stop DXP quickly and can be converted to a cluster configuration.
Prerequisites
Configure an Admin Server and a Managed Server following WebLogic’s documentation.
Liferay DXP/Portal requires a supported Java version to run. See JVM Configuration for recommended settings.
Download these files from the Help Center (subscription) or from Liferay Community Downloads:
- DXP WAR file
- OSGi Dependencies ZIP file
- Dependencies ZIP file (DXP 7.3 and earlier)
Preparing the DXP WAR
-
Unzip the DXP WAR file to an arbitrary location.
-
Create a file called
portal-ext.properties
in the expanded WAR’sWEB-INF/classes
folder. -
In the
portal-ext.properties
file, set theliferay.home
property to your Liferay Home folder path. In WebLogic,[Liferay Home]
is typically set to the domain’s folder (weblogic/domains
), but you can use any local folder. For example,liferay.home=/full/path/to/your/liferay/home/folder
ImportantThe liferay.home
directory must contain the Portal/DXPosgi/
directory. -
Package the
portal-ext.properties
in your DXP WAR file by expanding the DXP WAR file and copying theportal-ext.properties
file into theWEB-INF/classes
folder. -
Optionally, you can re-WAR the expanded DXP WAR. When you’re ready to deploy DXP, you can deploy it as an expanded archive or WAR file. In both cases, DXP reads the property settings once it starts up.
If you need to update portal-ext.properties
after DXP deploys, it is in the current location of the installed Liferay WAR under ROOT/WEB-INF/classes
. WebLogic may move the WAR during installation.
Configuring WebLogic
Configuring WebLogic’s Node Manager
WebLogic’s Node Manager starts and stops managed servers.
If you’re running WebLogic on a UNIX system other than Solaris or Linux, use the Java Node Manager, instead of the native version of the Node Manager, by configuring these Node Manager properties in the domains/your_domain_name/nodemanager/nodemanager.properties
file:
NativeVersionEnabled=false
StartScriptEnabled=true
By default, the Node Manager uses SSL. If you want to disable SSL during development, set SecureListener=false
in your nodemanager.properties
file.
See Oracle’s Configuring Java Node Manager documentation for details.
Configuring WebLogic’s JVM
Configure the JVM and other options in a setUserOverridesLate
WebLogic startup script and in your Managed Server UI.
-
Create a
setUserOverridesLate.sh
script in[Your Domain]/bin
. -
Add the following settings.
export DERBY_FLAG="false" export JAVA_OPTIONS="${JAVA_OPTIONS} -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Dlog4j2.formatMsgNoLookups=true -Duser.timezone=GMT -da:org.apache.lucene... -da:org.aspectj..." export JAVA_PROPERTIES="-Dfile.encoding=UTF-8 ${JAVA_PROPERTIES} ${CLUSTER_PROPERTIES}" export MW_HOME="[place your WebLogic Server folder path here]" export USER_MEM_ARGS="-Xms2560m -Xmx2560m -XX:MaxNewSize=1536m -XX:MaxMetaspaceSize=768m -XX:MetaspaceSize=768m -XX:NewSize=1536m -XX:SurvivorRatio=7"
The
DERBY_FLAG
setting disables the WebLogic’s built-in Derby server—DXP does not require this server.JAVA_OPTIONS
sets DXP’s UTF-8 requirement, Lucene usage, and Aspect Oriented Programming via AspectJ.JAVA_PROPERTIES
also sets DXP’s UTF-8 requirement.ImportantDXP requires the application server JVM to use the
GMT
time zone andUTF-8
file encoding.Set
MW_HOME
to the folder containing the WebLogic server. For example,export MW_HOME="/Users/ray/Oracle/wls12210"
The
*_MEM_ARGS
variables set DXP’s starting and maximum heap memory capacity. -
Make sure the Node Manager sets DXP’s memory requirements when starting the Managed Server. In the Admin Server’s console UI, navigate to the Managed Server where DXP is to be deployed and select the Server Start tab. Enter the following parameters into the Arguments field:
-Xms2560m -Xmx2560m -XX:MaxNewSize=1536m -XX:MaxMetaspaceSize=768m -XX:MetaspaceSize=768m -XX:NewSize=1536m -XX:SurvivorRatio=7
-
Click Save.
The Java options and memory arguments are explained below.
JVM Options Explained
Option | Explanation |
---|---|
-Dfile.encoding=UTF-8 | DXP requires UTF-8 file encoding. |
-Djava.net.preferIPv4Stack=true | Prefers an IPv4 stack over IPv6. |
-Dlog4j2.formatMsgNoLookups=true | Resolves a remote code execution (RCE) vulnerability. See LPS-143663 for details. |
-Duser.timezone=GMT | DXP requires the application server JVM to use the GMT time zone. |
Memory Arguments Explained
Memory Arguments | Explanation |
---|---|
-Xms | Initial space for the heap. |
-Xmx | Maximum space for the heap. |
-XX:NewSize | Initial new space. Setting the new size to half of the total heap typically provides better performance than using a smaller new size. |
-XX:MaxNewSize | Maximum new space. |
-XX:MetaspaceSize | Initial space for static content. |
-XX:MaxMetaspaceSize | Maximum space for static content. |
-XX:SurvivorRatio | Ratio of the new space to the survivor space. The survivor space holds young generation objects before being promoted to old generation space. |
After installing DXP, these configurations (including these JVM options) can be further tuned for improved performance. Please see Tuning Liferay and Tuning Your JVM for more information.
Installing Dependencies
DXP depends on OSGi modules (OSGi Dependencies ZIP) and a database driver.
-
Unzip the OSGi Dependencies ZIP file into the
[Liferay Home]/osgi
folder (create this folder if it doesn’t exist). Liferay’s OSGi runtime depends on these modules. -
The DXP 7.4+ WAR file includes drivers for MariaDB and PostgreSQL. Earlier DXP WARs don’t have them. If the 7.4+ WAR doesn’t have the driver for the supported database you’re using, download your database vendor’s JDBC JAR file and place it in the exploded DXP WAR’s
WEB-INF/shielded-container-lib
folder.See the compatibility matrix for a list of supported databases.
A Hypersonic database is bundled with DXP and is useful for testing purposes. Do not use HSQL for production instances.
For DXP 7.3 and earlier, unzip the Dependencies ZIP file to the WebLogic domain’s lib
folder. Place your database vendor’s JDBC JAR file in that folder too.
Installing Elasticsearch
When you start Liferay, it installs and starts a default sidecar Elasticsearch server. When installing on WebLogic you should set up a remote Elasticsearch server right from the start. See Getting Started with Elasticsearch.
When Liferay DXP is configured (using .config
files for the Elasticsearch connector) and started with Elasticsearch already configured and running, the connection to Elasticsearch is activated.
Connect to Database
DXP contains a built-in Hypersonic database for demonstration purposes, but it should not be used in production. Use a full-featured, supported database. See Configure a Database to set up your database.
Liferay DXP can connect to your database using DXP’s built-in data source (recommended) or a JNDI data source on your app server.
You can configure DXP’s built-in data source with your database the first time you run DXP by using the Setup Wizard. Or you can configure the data source in a portal-ext.properties
file based on the Database Template for your database.
Otherwise, you can configure the data source in WebLogic.
-
Get the JDBC JAR from your DXP WAR (7.4+) or from the database vendor, and copy it to the domain’s
lib
folder. -
Log in to the AdminServer console.
-
In the Domain Structure tree, find the domain and navigate to Services → JDBC → Data Sources.
-
To create a new data source, click New.
-
Enter the Name field with
Liferay Data Source
and the JNDI Name field withjdbc/LiferayPool
. -
Select the database type and driver. For example, MySQL is MySQL’s Driver (Type 4) Versions:using com.mysql.cj.jdbc.Driver.
-
Click Next to continue.
-
Accept the default settings on this page and click Next to move on.
-
Fill in the database information for the MySQL database.
-
If using MySQL, add the text
?useUnicode=true&characterEncoding=UTF-8&\useFastDateParsing=false
to the URL line and test the connection. If it works, click Next. -
Select the target for the data source and click Finish.
-
Connect DXP to the JDBC data source. In the
portal-ext.properties
file (see above), enter the data source JNDI name. For example,jdbc.default.jndi.name=jdbc/LiferayPool
Connect to Mail Server
You can connect Liferay DXP to a mail server using its built-in mail session. Otherwise, you can use WebLogic’s mail session:
-
Start WebLogic and log in to the Admin Server’s console.
-
Select Services → Mail Sessions from the Domain Structure box on the left hand side of the Admin Server’s console UI.
-
Click New to begin creating a new mail session.
-
Name the session LiferayMail and give it the JNDI name
mail/MailSession
. -
Enter the Session Username, Session Password, Confirm Session Password, and JavaMail Properties fields as necessary for the mail server. See the WebLogic documentation for more information on these fields.
-
Click Next.
-
Choose the Managed Server where DXP is to be installed on, and click Finish.
-
Shut down the Managed and Admin Servers.
-
With the Managed and Admin servers shut down, add the following property to the
portal-ext.properties
file in Liferay Home:mail.session.jndi.name=mail/MailSession
After DXP is deployed, the portal-ext.properties
file can be found in the domain’s autodeploy/ROOT/WEB-INF/classes
folder.
The changes take effect upon restarting the Managed and Admin servers.
Deploying DXP
Follow these steps to deploy the DXP WAR file:
-
Verify that the designated Managed Server where you’re deploying DXP is shut down.
-
In the Admin Server’s console UI, select Deployments from the Domain Structure box on the left hand side.
-
Click Install to start a new deployment.
-
Select the DXP WAR file or its expanded contents on the machine. Alternatively, upload the WAR file by clicking the Upload your file(s) link. Click Next.
-
Select Install this deployment as an application and click Next.
-
Select the designated Managed Server where you’re deploying DXP and click Next.
-
If the default name is appropriate for the installation, keep it. Otherwise, enter a different name and click Next.
-
Click Finish.
-
After the deployment finishes, click Save if the configuration is correct.
-
Start the Managed Server where you deployed DXP. DXP precompiles all the JSPs and then launches.
After deploying DXP, you may see excessive warnings and log messages such as the ones below, involving PhaseOptimizer
. These are benign and can be ignored. You can turn off these messages by adjusting the app server’s logging level or log filters.
May 02, 2018 9:12:27 PM com.google.javascript.jscomp.PhaseOptimizer$NamedPass process
WARNING: Skipping pass gatherExternProperties
May 02, 2018 9:12:27 PM com.google.javascript.jscomp.PhaseOptimizer$NamedPass process
WARNING: Skipping pass checkControlFlow
May 02, 2018 9:12:27 PM com.google.javascript.jscomp.PhaseOptimizer$NamedPass process
INFO: pass supports: [ES3 keywords as identifiers, getters, reserved words as properties, setters, string continuation, trailing comma, array pattern rest, arrow function, binary literal, block-scoped function declaration, class, computed property, const declaration, default parameter, destructuring, extended object literal, for-of loop, generator, let declaration, member declaration, new.target, octal literal, RegExp flag 'u', RegExp flag 'y', rest parameter, spread expression, super, template literal, modules, exponent operator (**), async function, trailing comma in param list]
current AST contains: [ES3 keywords as identifiers, getters, reserved words as properties, setters, string continuation, trailing comma, array pattern rest, arrow function, binary literal, block-scoped function declaration, class, computed property, const declaration, default parameter, destructuring, extended object literal, for-of loop, generator, let declaration, member declaration, new.target, octal literal, RegExp flag 'u', RegExp flag 'y', rest parameter, spread expression, super, template literal, exponent operator (**), async function, trailing comma in param list, object literals with spread, object pattern rest]
If you have a Liferay DXP Enterprise subscription, DXP requests your activation key. See Activating Liferay DXP for more information.
Congratulations! You’re running DXP on WebLogic.
Next Steps
You can sign in as your administrator user and start building a solution on DXP. Or you can explore additional Liferay DXP setup topics: