07 December, 2017

Liferay DXP setup with Weblogic

Download latest DXP version

  1. For Enterprise Edition, we need to download Liferay DXP 
  2. For Community Edition, we need to download Liferay Portal

As we are using (EE ) Enterprise Edition, we will download Liferay DXP.

Note:Download latest DXP server from Liferay customer portal, using the credentials provided by Liferay as part of licensing agreement. Download Liferay DXP’s WAR file and dependencies from the Customer Portal
Go to Products>>Liferay DXP click on Downloads


You’ll need the following files:
· liferay-dxp-digital-enterprise-[version].war: Liferay DXP WAR file
· liferay-dxp-digital-enterprise-dependencies-[version].zip: Liferay DXP dependencies

· liferay-dxp-digital-enterprise-osgi-[version].zip: Liferay DXP OSGi dependencies

Configuring Web Logic’s Node Manager

WebLogic requires a Node Manager to start and stop managed servers. Before installing Liferay DXP, you must configure the Node Manager included with your WebLogic installation. You’ll do this via the domains/your_domain_name/nodemanager/nodemanager.properties file. Open this file, and set the SecureListener property to false:

we have below path for setup :
/u01/app1/oracle/product/fmw12C/user_projects/domains/base_domain/nodemanager

If you’re running WebLogic on Mac or Linux, you may also need to set the nativeVersionEnabled property to false.

Also note that with SecureListener set to true, you must configure your machine in the Admin Server’s console to accept unencrypted connections from the Node Manager. To do this, first log in to your Admin Server and select Environment → Machines from the Domain Structure box on the left. Click your machine in the table and then select the Configuration → Node Manager tab. In the Type field, select Plain from the selector menu, and then click Save. You must restart your Admin Server for this change to take effect. 



Configuring Weblogic

Next, you must set some variables in two WebLogic startup scripts. These variables and scripts are as follows. Be sure to use set instead of export if you’re on Windows. 
1. your-domain/startWebLogic.[cmd|sh]This is the Admin Server’s startup script.
2. your-domain/bin/startWebLogic.[cmd|sh]This is the startup script for Managed Servers. 
Sample path for above files would be :
/u01/app/oracle/product/fmw1/user_projects/domains/base_domain/bin

Add the following variables to both startWebLogic.[cmd|sh] scripts:
export DERBY_FLAG="false"
export JAVA_OPTIONS="${JAVA_OPTIONS} -Dfile.encoding=UTF-8 -da:org.apache.lucene... -da:org.aspectj..."
export MW_HOME="u01/app1/oracle/product/fmw12C/wlserver"
export USER_MEM_ARGS="-Xmx1024m -XX:MetaspaceSize=512m"

Also make sure to set MW_HOME to the directory containing your WebLogic server on your machine. For example: (leave it as is as $MW_HOME)
/home/oracle/Oracle_Home/wlserver
You must also ensure that the Node Manager sets Liferay DXP’s memory requirements when starting the Managed Server. In the Admin Server’s console UI, navigate to the Managed Server you want to deploy Liferay DXP to and select the Server Start tab. Enter the following into the Arguments field: 
-Xmx2048m -XX:MaxMetaspaceSize=512m
Click Save when you’re finished. 

Setting Liferay DXP Properties

Before installing Liferay DXP, you must need to set the Liferay Home folder’s location via the liferay.home property in a portal-ext.properties file. You can also use this file to override other Liferay DXP properties that you may need. 

1. First, decide which directory you want to serve as Liferay Home. In WebLogic, your domain’s folder is generally Liferay Home, but you can choose any folder on your machine. Then create your portal-ext.properties file and add the liferay.home property: 

 liferay.home=/u01/app/oracle/product/fmw1/user_projects/domains

Also keep one version of Portal-ext.properties file will be save in above path which will be useful to override properties in future and make sure just keep liferay.home in portal-ext.properties .This can be override anytime once liferay home path set in portal-ext which we will keep in war file of liferay DXP.

How to put portal-ext.properties in DXP war file

Now, we have to extract War file (for e.g liferay-dxp-digital-enterprise-7.0-sp6-20171010144253003.war) and in that WEB-INF/classes folder we have to place portal-ext.properties and re-war it again.

Take backup of that DXP war file at same path and rename it as backup
Copy the original war file to tmp folder and follow below steps to extract from war and re-war.

cp warfile.war /tmp
cd /tmp
unzip warfile.war
cd WEB-INF
cd classes

Go to the path where your portal-ext.properties file is saved , Go to domain path: /u01/app/oracle/product/fmw1/user_projects/domains
cp portal-ext.properties  /u01/app/oracle/product/fmw1/user_projects/domains/base_domain/tmp/WEB-INF/classes

cd ...
cd ..
zip -r -u warfile.war WEB-INF
zip –r –u warfile.war dtd
zip –r –u warfile.war errors
zip –r –u warfile.war html
zip –r –u warfile.war index.jsp
zip –r –u warfile.war layouttpl

By this way again in tmp folder that war file will be ready. Copy that war file outside that temp folder at below path:
/u01/app/oracle/product/fmw1/user_projects/domains/base_domain

Now in future if you want to modify portal-ext, then you don't need to touch properties which we kept inside war file. you can just go to liferay home path which you set earlier and can override portal-ext.properties.

Installing Liferay DXP dependencies

1. unzip zip file (liferay-dxp-digital-enterprise-dependencies-)at below folder and place 7 files including ojdbc.jar file

/u01/app/oracle/product/fmw12C/user_projects/domains/base_domain/lib

2.liferay-dxp-digital-enterprise-osgi-[version].zipUnzip this file and place its contents in the Liferay_Home/osgi folder (/u01/app/oracle/product/fmw12C/user_projects/domains/osgi) If file not there so please create it

3. Copy ojdbc .jar file in /u01/app/oracle/product/fmw12C/user_projects/domains/base_domain/lib folder

Security Configuration

You must have to enable Java Security on your WebLogic server and specify a security policy to grant Liferay DXP access to your server. 
First, you’ll grant Liferay DXP access to your server. This configuration opens all permissions–you can fine-tune your policy’s permissions later. If it doesn’t already exist, create a policy file named weblogic.policy in your $WL_HOME/server/lib folder. 
/u01/app/oracle/product/fmw/ wlserver_10.3 /server/lib
Replace its contents with the following: 
grant {
    permission java.security.AllPermission;
};

To enable security on your WebLogic server and direct the server to your policy file, 
open the setDomainEnv.[cmd|sh] file in your domain’s bin folder. 
Then set the -Djava.security.manager Java option and set the property 
-Djava.security.policy to your weblogic.policy file. You can specify both settings on the same line like this:
Path to go is = /u01/app/oracle/product/fmw1/user_projects/domains/base_domain/bin
-Djava.security.manager -Djava.security.policy==$WL_HOME/server/lib/weblogic.policy

The double equals sign tells the app server to use only this policy file. Any other security policies are ignored.

In Weblogic console >> <Your-Managed-Server> , Go to Server_stat tab and add “-Xmx2048m -XX:MaxMetaspaceSize=512m” in Arguments box

Deploying Liferay DXP

Note:Before you start DXP deployment, just restart weblogic server so that dependencies which you kept in weblogic classpath will get loaded.

As mentioned earlier, although you can deploy Liferay DXP to a WebLogic Admin Server, you should instead deploy it to a WebLogic Managed Server. Dedicating the Admin Server to managing other servers that run your apps is a best practice. 
Follow these steps to deploy Liferay DXP to a Managed Server: 

1. Make sure the Managed Server you want to deploy Liferay DXP to, is shut down.



2.In your Admin Server’s console UI, select Deployments from the Domain Structure box on the left hand side. Then click Install to start a new deployment. 


3.Select the Liferay DXP WAR file or its expanded contents on your file system. It will take your domain patch already. Alternatively, you can upload the WAR file by clicking the Upload your file(s) link. Click Next


4.Select Install this deployment as an application and click Next.



5.Select the Managed Server you want to deploy Liferay DXP to, and click Next



6.If the default name is appropriate for your installation, keep it. Otherwise, give it a name of your choosing and click Next

7.Click Finish. After the deployment finishes, click Save if you want to save the configuration. 
8.Start the Managed Server you deployed Liferay DXP to. Liferay DXP precompiles all the JSPs, and then launches. 

Note:
When you will start managed server and if you you will get error for boot.properties, so again enter below details in booth.properties.
Username=weblogic username
Password:weblogicpassword
For changing details in boot.properties, path is: 
/u01/app/oracle/product/fmw1/user_projects/domains/base_domain/servers/<your-server-name>/security 
Once it will show server is up. Liferay should also up. You can check from the below url that Lifray is also running

Popular Posts

Featured Post

Liferay 7.3 compatibility matrix

Compatibility Matrix Liferay's general policy is to test Liferay Portal CE against newer major releases of operating systems, open s...