As I mentioned in the previous post, I have decided to move away from micro-services. To achieve this, I am taking an AWS EC2 instance and configuring each micro-service on this instance. For this setup, I am using an Ubuntu 16.04 machine because my application setup is a bit old. However, if you have newer versions of Rails, Ruby, etc., you may want to choose Ubuntu 20.04.
Our setup includes Ruby on Rails (5.2.1) micro-services (5-10 in number), a NodeJS application, a Sinatra Application, and an Angular 9.1 Front-End Application.
To begin, go to the AWS EC2 home page and select an Ubuntu 16.04 machine with default configurations and SSH enabled.
Install Mysql 5.7 (Remember this is for Ubuntu 16.04, 18.04 versions)
sudo apt-get install mysql-server-5.7 mysql-client-core-5.7 libmysqlclient-dev
sudo service mysql status # or
systemctl status mysql
username: <your-username>, password: <your-password>
You can also try mysql_secure_installation, if you use other mysql version.
Note that if you are setting up Ubuntu 20.04, there is a significant change in MySQL, as the version of MySQL is now 8.0 instead of 5.7. If you have applications running in MySQL 5.7, it is recommended that you set up and use Ubuntu 16.04 or 18.04.
We will continue the installation process in our next post.
Go inside the downloaded liferay portal folder. And start the tomcat server
cd ~/liferay-ce-portal-tomcat-7.3.0-ga1-20200127150653953/liferay-ce-portal-7.3.0-ga1/tomcat-9.0.17/bin
sh startup.sh
Goto http://localhost:8080/ and start setting up liferay configurations as follows:
Do the basic configuration and change database to mysql
Mysql database is recommended fot staging and production environment.
JDBC URL: jdbc:mysql://localhost/lportal?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&serverTimezone =GMT&useFastDateParsing=false&useUnicode=true JDBC Driver Class Name: com.mysql.cj.jdbc.Driver
If you get the error like this, some of your provided mysql configuration went wrong. Check your mysql username and password.
If the given mysql configuration is correct, then you have to check the Liferay DB exists in your Mysql database. Else create the DB `lportal` as follows:
Create database ‘lportal’
Now click on the Configure button, you will be ready to go
Open ‘~/liferay-ce-portal-tomcat-7.3.0-ga1-20200127150653953/liferay-ce-portal-7.3.0-ga1/portal-setup-wizard.properties’ file and you can see the above configurations added by liferay.
You can see the above server log in Dev studio. Here mentioned about which property files loads during the start and picking MYSQL DB, creating tables for first time in `lportal` database, inserting data to the table
You can see the following tables populated in the database lportal
Here is the list of Users created. We are selected `Add Sample data` option at the time configuration. That is why we can see lot of users with my domain is listed
Login with
Email: provide the email given at the time of register
Password: test (default password for version 7.3)
If you are using Liferay7.2 version, then this default password may not work. In this versionliferay generates a random password, that you can check in the log file as below:
cd ~/Downloads/liferay-ce-portal-tomcat-7.2.1-ga2-20191111141448326/liferay-ce-portal-7.2.1-ga2/tomcat-9.0.17/logs/ && tail -f catalina.out
Search word password. You can get it.
After login you can see this terms of use page
Then a Password remainder page
DONE! Congrats, you can see the admin home page with all controls
changing to new db from old db
Add the new db name ‘liferay721’ to portal-setup-wizard.properties
Starting Liferay Community Edition Portal 7.2.1 CE GA2 (Mueller / Build 7201 / November 12, 2019)
2020-05-08 14:45:53.921 INFO [main][StartupHelper:75] There are no patches installed
2020-05-08 14:45:54.000 WARN [main][ReleaseLocalServiceImpl:238] Table 'liferay721.Release_' doesn't exist
2020-05-08 14:45:54.003 INFO [main][ReleaseLocalServiceImpl:129] Create tables and populate with default data
...................
...................
Issues you may face during the setup
Once I created a DB names liferay_7_3_1 and the setup wizard finishes successfully and message shown to restart the server for get into the portal.
When I restart it I received the following issue:
An unexpected system error occurred.
java.lang.NullPointerException
Database is not setup properly. Check the DB name. Use characters as DB name if possible and start the server. If proper DB setup is done, then you can see 250 – 280 tables in database
and the following tables were created in the database named liferay_7_3_1
Then I renamed the DB to liferay731. Then it works! So beware of underscore characters in your DB name.
Another error is shown when the server is not able to connect to your database, or database is not created that is specified as in your portal.ext.properties or portal-setup-wizard.properties
Create a database specified in properties file to get rid of the issue. Else check given DB permissions are correct