Install v7.0 wildfly bundle (Liferay)

Index

References

https://dev.liferay.com/discover/deployment/-/knowledge_base/7-0/installing-liferay-on-wildfly-10

https://mirocupak.com/enabling-long-deployments-on-wildfly/

MySQL 5.6 on Ubuntu 14.04 LTS > http://sharadchhetri.com/2014/05/07/install-mysql-server-5-6-ubuntu-14-04-lts-trusty-tahr/

Introduction

According to the compatibility matrix (see Liferay portal), let's proceed to install with the following configuration: Ubuntu LTS 14.04, MySQL 5.6, Wildfly 10.0 and Oracle JDK 8.

Ubuntu install

Let's have an Ubuntu server LTS 14.04 ready. For testing purposes, we're using Vagrant for running a VirtualBox VM.

JDK 8 install

Reference > http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

sudo apt-add-repository ppa:webupd8team/java sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default

Liferay - Wildfly bundle install

Create a directory where to extract the bundle

sudo mkdir /opt/portal

Ensure 'unzip' is available

sudo apt-get install unzip

Extract the downloaded bundle

$ unzip liferay-ce-portal-wildfly-7.0-ga3-20160804222206210.zip
$ sudo mv liferay-ce-portal-7.0-ga3/ /opt/
$ sudo ln -s /opt/liferay-ce-portal-7.0-ga3/ /opt/liferay

Start server

$ cd /opt/liferay/wildfly-10.0.0/bin/ && sudo ./standalone.sh -b=0.0.0.0 -bmanagement=0.0.0.0

If you get an insufficient memory error (eg. when the machine only has 512 MB):

# There is insufficient memory for the Java Runtime Environment to continue.

# Native memory allocation (mmap) failed to map 42860544 bytes for committing reserved memory.

then increase the machine memory (eg. up to 3.5 GB).

Since initial ROOT.war deployment failed, it exists the generated .failed file:

/opt/portal/liferay-ce-portal-7.0-ga3/wildfly-10.0.0/standalone/deployments/ROOT.war.failed

If you get a deployment timeout exception [https://mirocupak.com/enabling-long-deployments-on-wildfly/]

Console error: "WFLYDS0022: Did not receive a response to the deployment operation within the allowed timeout period [360 seconds]. Check the server configuration file and the server logs to find more about the status of the deployment."vagrant@vagrant-ubuntu-trusty-64:/opt/liferay/wildfly-10.0.0/standalone"

then modify standalone.xml to increase the default 5 minutes to, eg, 15 minutes:

... <system-properties>
    ...

<property name="jboss.as.management.blocking.timeout" value="900"/> </system-properties> ... <profile> ...

     <subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
         <deployment-scanner deployment-timeout="900" path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000"
                             runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
     </subsystem>
    ... </profile> ...

The following log shows that first boot took, in this case, 10.97 minutes:

...
10:14:25,615 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 33) WFLYSRV0010: Deployed "ROOT.war" (runtime-name : "ROOT.war")
10:14:25,958 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://0.0.0.0:9990/management
10:14:25,959 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://0.0.0.0:9990
10:14:25,960 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) started in 658200ms - Started 2593 of 2881 services (378 services are lazy, passive or on-demand)

Liferay Portal is now up and ready:

http://liferay.local:8080/

CHANGE DATABASE (quick start next step)

The Liferay Portal bundle uses an embedded database to make installation fast and easy. This database is not ready for production so consider configuring Liferay to use a production-ready database available to you (MySQL, Oracle, etc).

Official wiki > http://www.liferay.com/community/wiki/-/wiki/Main/Database+Configuration

Liferay developer network > https://dev.liferay.com/discover/deployment/-/knowledge_base/7-0/installing-liferay-on-wildfly-10

Let's make Wildfly to manage the database connection.

portal-ext.properties

Create or edit file portal-ext.properties on Liferay Home directory:

touch /opt/liferay/portal-ext.properties

with content:

jdbc.default.jndi.name=java:jboss/datasources/LiferayDS

note you can use any 'name' you wish instead of 'LiferayDS' (Wildfly uses 'ExampleDS' by default).

LINE CURRENTLY COMMENTED OUT, SINCE SERVER DOES NOT START.... PENDING FINDING A SOLUTION

MySQL install

Let's install the version indicated by the Liferay compatibility matrix: 5.6

sudo apt-get update
sudo apt-get install mysql-server-5.6

whenever asked for 'root' password enter it. Eg: 'root' was used for these testing purposes.

Ensure the MySQL daemon is running:

$ sudo netstat -nltp | grep mysql
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      10715/mysqld

MySQL quick reference:

//Login, using password previously set
mysql -u root -p
//Restart, start, stop or status
sudo service mysql restart
sudo service mysql start
sudo service mysql stop
sudo service mysql status

Create the liferayadmin user and lportal database in MySQL:

CREATE USER 'liferayadmin' IDENTIFIED BY 'liferayadmin';
create database lportal character set utf8;
GRANT ALL PRIVILEGES ON lportal.* TO 'liferayadmin'@'localhost'
IDENTIFIED BY 'liferayadmin';
GRANT ALL PRIVILEGES ON lportal.* TO 'liferayadmin'@'127.0.0.1'
IDENTIFIED BY 'liferayadmin';
GRANT ALL PRIVILEGES ON lportal.* TO 'liferayadmin'@'10.0.2.15'
IDENTIFIED BY 'liferayadmin';
FLUSH PRIVILEGES;

Test the connection from the machine with Liferay/Wildfly bundle:

$ mysql -u liferayadmin -p --protocol=TCP --host=localhost --port=3306

Modify standalone.xml and add your data source and driver in the <datasources> element of your data sources subsystem.

  1. First, add your data source inside the <datasources> element.
    1. <datasource jndi-name="java:jboss/datasources/LiferayDS" pool-name="LiferayDS" enabled="true" jta="true" use-java-context="true" use-ccm="true">
    2. <connection-url>jdbc:mysql://localhost/lportal?characterEncoding=UTF-8&amp;dontTrackOpenResources=true&amp;holdResultsOpenOverStatementClose=true&amp;useFastDateParsing=false&amp;useUnicode=true</connection-url>
    3. <driver>mysql</driver>
    4. <security>
    5. <user-name>liferayadmin</user-name>
    6. <password>liferayadmin</password>
    7. </security>
    8. <validation>
    9. <check-valid-connection-sql>/* ping */ SELECT 1</check-valid-connection-sql>
    10. </validation>
    11. </datasource>

Be sure to replace the database name (i.e. lportal), user name, and password with the appropriate values.

Note 1: If you’d like to change your datasource jndi-name to something different, you’ll need to also edit the datasource element in the <default-bindings> tag.

Note 2: Since we have changed the default datasource jndi-name from 'ExampleDS' to 'LiferayDS', we’ll need to also edit the datasource element in the <default-bindings> tag:

<default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/LiferayDS" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>

    1. Add your driver to the <drivers> element also found within the <datasources> element.
    2. <drivers>
    3. ...
    4. <driver name="mysql" module="com.liferay.portal">
    5. <driver-class>com.mysql.jdbc.Driver</driver-class>
    6. </driver>
    7. </drivers>

Note that MySql driver "mysql.jar" is already present in directory /opt/liferay/wildfly-10.0.0/modules/com/liferay/portal/main/

and referenced in the file module.xml

CONFIGURE EMAIL NOTIFICATIONS (quick start next step)

Official wiki > http://www.liferay.com/community/wiki/-/wiki/Main/SMTP+Setup

READ OFFICIAL DOCUMENTATION (quick start next step)

http://www.liferay.com/documentation

LEARN MORE ON OUR WIKI (quick start next step)

http://wiki.liferay.com

ASK QUESTIONS ON OUR FORUM (quick start next step)

http://forum.liferay.com

GET PROFESSIONAL SUPPORT (quick start next step)

http://www.liferay.com/services