Setup Liferay 7.4 CE on Linux

Created: 19 November 2024  Modified:

Steps to setup Liferay 7.4 CE

  1. Install and start Mariadb

Fedora shell commands

$ sudo dnf install mariadb
$ sudo dnf install mariadb-server
$ sudo systemctl enable mariadb
$ sudo systemctl start mariadb
$ sudo systemctl status mariadb
  1. Access Mariadb

Fedora Shell command

$ sudo mariadb
[sudo] password for user:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 14
Server version: 10.11.10-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

Mariadb commands

MariaDB [(none)]> create database lportal default character set utf8mb4 collate utf8mb4_unicode_ci;
MariaDB [(none)]> CREATE USER 'liferay'@'localhost' IDENTIFIED BY 'liferay';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON lportal.* TO 'liferay'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> SHOW GRANTS FOR 'liferay'@'localhost';
MariaDB [(none)]> quit

Fedora shell commands

$ sudo dnf install java-17-openjdk

portal-ext.properties

jdbc.default.driverClassName=org.mariadb.jdbc.Driver
jdbc.default.url=jdbc:mariadb://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=liferay
jdbc.default.password=liferay
server.tomcat.main.host=localliferay

Fedora Shell

$ cd ~/liferay-portal/tomcat/bin
$ ./startup.sh
Using CATALINA_BASE:   /home/chris/liferay-portal/tomcat
Using CATALINA_HOME:   /home/chris/liferay-portal/tomcat
Using CATALINA_TMPDIR: /home/chris/liferay-portal/tomcat/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /home/chris/liferay-portal/tomcat/bin/bootstrap.jar:/home/chris/liferay-portal/tomcat/bin/tomcat-juli.jar
Using CATALINA_OPTS:    -Dfile.encoding=UTF-8 -Djava.locale.providers=JRE,COMPAT,CLDR -Djava.net.preferIPv4Stack=true -Duser.timezone=GMT -Xms2560m -Xmx2560m -XX:MaxNewSize=1536m -XX:MaxMetaspaceSize=768m -XX:MetaspaceSize=768m -XX:NewSize=1536m -XX:SurvivorRatio=7
Tomcat started.

log file excerpt

2024-11-18 17:15:36.424 INFO  [http-nio-8080-exec-1][BundleSiteInitializer:493] Initializing com.liferay.site.initializer.welcome for group 20117
2024-11-18 17:15:36.481 INFO  [http-nio-8080-exec-1][BundleSiteInitializer:5547] Invoking addOrUpdateExpandoColumns took 8 ms
2024-11-18 17:15:36.485 INFO  [http-nio-8080-exec-1][BundleSiteInitializer:5547] Invoking addSiteSettings took 0 ms
2024-11-18 17:15:36.487 INFO  [http-nio-8080-exec-1][BundleSiteInitializer:5547] Invoking addOrUpdateOrganizations took 0 ms
2024-11-18 17:15:36.488 INFO  [http-nio-8080-exec-1][BundleSiteInitializer:5547] Invoking addAccounts took 0 ms
2024-11-18 17:15:36.489 INFO  [http-nio-8080-exec-1][BundleSiteInitializer:5547] Invoking addOrUpdateSAPEntries took 0 ms
2024-11-18 17:15:36.490 INFO  [http-nio-8080-exec-1][BundleSiteInitializer:5547] Invoking addOrUpdateUserGroups took 0 ms

Fedora shell command

$ cd ~/liferay-portal/tomcat/bin
$ ./shutdown.sh
Using CATALINA_BASE:   /home/chris/liferay-portal/tomcat
Using CATALINA_HOME:   /home/chris/liferay-portal/tomcat
Using CATALINA_TMPDIR: /home/chris/liferay-portal/tomcat/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /home/chris/liferay-portal/tomcat/bin/bootstrap.jar:/home/chris/liferay-portal/tomcat/bin/tomcat-juli.jar
Using CATALINA_OPTS:    -Dfile.encoding=UTF-8 -Djava.locale.providers=JRE,COMPAT,CLDR -Djava.net.preferIPv4Stack=true -Duser.timezone=GMT -Xms2560m -Xmx2560m -XX:MaxNewSize=1536m -XX:MaxMetaspaceSize=768m -XX:MetaspaceSize=768m -XX:NewSize=1536m -XX:SurvivorRatio=7
NOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.https=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-opens=jdk.zipfs/jdk.nio.zipfs=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED

Fedora shell commands

$ sudo systemctl disable firewalld
$ sudo systemctl stop firewalld
$ sudo hostnamectl set-hostname fedora-liferay-1
tags: java - liferay ce - liferay - ce - mariadb - fedora - 41 - fedora 41 - linux
   Less Is More