{"id":2883,"date":"2018-02-15T20:28:00","date_gmt":"2018-02-15T17:28:00","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/debian-liferay-cms\/"},"modified":"2018-02-15T20:28:00","modified_gmt":"2018-02-15T17:28:00","slug":"how-to-install-liferay-cms-on-debian-9","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/how-to-install-liferay-cms-on-debian-9\/","title":{"rendered":"How to Install Liferay CMS on Debian 9"},"content":{"rendered":"<div><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/02\/how-to-install-liferay-cms-on-debian-9.gif\" class=\"ff-og-image-inserted\" alt=\"\" title=\"\"><\/div>\n<p>Liferay is a free and open source content management software written in Java and uses MySQL to store their data. Liferay is a web based application portal that can be used to build websites and portals as an assembly of themes, pages, and a common navigation. Liferay comes with simple and easy to use programming interface that allows users with no programming skills for the basic website installation and administration. Liferay supports for the variety of extensions and plug-ins for many programming languages.<\/p>\n<p>In this tutorial, we will show you how to install Liferay on Debian 9 server.<\/p>\n<h2 id=\"requirements\">Requirements<\/h2>\n<ul>\n<li>A server running Debian 9.<\/li>\n<li>A non-root user with sudo privileges.<\/li>\n<\/ul>\n<h2 id=\"update-the-system\">Update the System<\/h2>\n<p>Before starting, update the system with the latest version. You can do this with the following command:<\/p>\n<p class=\"command\">sudo apt-get update -y<br \/>sudo apt-get upgrade -y<\/p>\n<p>Once your system is up-to-date, restart the system to apply all the updates.<\/p>\n<h2 id=\"install-java\">Install Java<\/h2>\n<p>Xwiki is a Java based application, so you will need to install Java 8 first. By default Java 8 is not available in the Debian 9 repository. You can install Java 8 by adding the webupd8team PPA repository to your system.<\/p>\n<p>First, add the PPA by running the following command:<\/p>\n<p class=\"command\">sudo add-apt-repository ppa:webupd8team\/java<\/p>\n<p>Next, update the repository with the following command:<\/p>\n<p class=\"command\">sudo apt-get update -y<\/p>\n<p>Once the repository is up to date, you can install Java 8 by running the following command:<\/p>\n<p class=\"command\">sudo apt-get install oracle-java8-installer -y<\/p>\n<p>After installing Java, you can check the version of Java with the following command:<\/p>\n<p class=\"command\">java -version<\/p>\n<p>You should see the following output:<\/p>\n<pre>java version \"1.8.0_161\"&#13;\nJava(TM) SE Runtime Environment (build 1.8.0_161-b12)&#13;\nJava HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)&#13;\n<\/pre>\n<h2 id=\"install-mariadb\">Install MariaDB<\/h2>\n<p>By default, the latest version of the MariaDB is not available in Debian 9 default repository. So you will need to add the MariaDB repository to your system. You can add the repository by running the following command:<\/p>\n<p class=\"command\">sudo apt-get install software-properties-common -y<br \/>sudo apt-key adv &#8211;recv-keys &#8211;keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8<br \/>sudo add-apt-repository &#8216;deb [arch=amd64] http:\/\/www.ftp.saix.net\/DB\/mariadb\/repo\/10.1\/debian stretch main&#8217;<\/p>\n<p>Next, update the repository by running the following command:<\/p>\n<p class=\"command\">sudo apt-get update -y<\/p>\n<p>Finally, install the MariaDB server with the following command:<\/p>\n<p class=\"command\">sudo apt-get install mariadb-server -y<\/p>\n<p>By default, MariaDB installation is not secured. So you will need to secure it first. You can do this by running the <code>mysql_secure_installation<\/code> script.<\/p>\n<p class=\"command\">sudo mysql_secure_installation<\/p>\n<p>Answer all the questions as shown below:<\/p>\n<pre> &#13;\nEnter current password for root (enter for none): Enter&#13;\nSet root password? [Y\/n]: Y&#13;\nNew password: <your-password>&#13;\nRe-enter new password: <your-password>&#13;\nRemove anonymous users? [Y\/n]: Y&#13;\nDisallow root login remotely? [Y\/n]: Y&#13;\nRemove test database and access to it? [Y\/n]: Y&#13;\nReload privilege tables now? [Y\/n]: Y&#13;\n<\/your-password><\/your-password><\/pre>\n<p>The above script will set the root password, remove test database, remove anonymous user and Disallow root login from a remote location.<\/p>\n<p>Once the MariaDB installation is secured, start the MariaDB service and enable it to start on boot time by running the following command:<\/p>\n<p class=\"command\">sudo systemctl start mysql<br \/>sudo systemctl enable mysql<\/p>\n<p>Next, you will need to create a database and user for liferay. First, log in to MariaDB shell using the following command:<\/p>\n<p class=\"command\">mysql -u root -p<\/p>\n<p>Enter your root password, then create a database for liferay with the following command:<\/p>\n<p class=\"command\">MariaDB [(none)]&gt;CREATE DATABASE lportal;<\/p>\n<p>Next, create a username and password for liferay with the following command:<\/p>\n<p class=\"command\">MariaDB [(none)]&gt;CREATE USER &#8216;lportal&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;password&#8217;;<\/p>\n<p>Next, grant privileges to the lportal database with the following command:<\/p>\n<p class=\"command\">MariaDB [(none)]&gt;GRANT ALL PRIVILEGES ON lportal.* TO &#8216;lportal&#8217;@&#8217;localhost&#8217;;<\/p>\n<p>Next, flush the privileges with the following command:<\/p>\n<p class=\"command\">MariaDB [(none)]&gt;flush privileges;<\/p>\n<p>Finally close the MySQL console:<\/p>\n<p class=\"command\">MariaDB [(none)]&gt;exit;<\/p>\n<h2 id=\"download-and-install-liferay\">Download and Install Liferay<\/h2>\n<p>First, you will need to download the latest version of the Liferay application bundled with Apache Tomcat. You can download it with the following command:<\/p>\n<p class=\"command\">wget https:\/\/excellmedia.dl.sourceforge.net\/project\/lportal\/Liferay%20Portal\/7.0.4%20GA5\/liferay-ce-portal-tomcat-7.0-ga5-20171018150113838.zip<\/p>\n<p>Once the download is completed, extract the downloaded file with the following command:<\/p>\n<p class=\"command\">unzip liferay-ce-portal-tomcat-7.0-ga5-20171018150113838.zip<\/p>\n<p>Next, copy the extracted directory to the \/var\/ directory:<\/p>\n<p class=\"command\">sudo cp -r liferay-ce-portal-7.0-ga5 \/var\/liferay<\/p>\n<p>Next, you will need to create a new portal-ext.properties file and add MySQL details. You can do this using the following command:<\/p>\n<p class=\"command\">sudo nano \/var\/liferay\/tomcat-8.0.32\/webapps\/ROOT\/WEB-INF\/classes\/portal-ext.properties<\/p>\n<p>Add the following lines:<\/p>\n<pre>jdbc.default.url=jdbc\\:mysql\\:\/\/localhost\/lportal?useUnicode\\=true&amp;characterEncoding\\=UTF-8&amp;useFastDateParsing\\=false&#13;\njdbc.default.driverClassName=com.mysql.jdbc.Driver&#13;\njdbc.default.username=lportal&#13;\njdbc.default.password=password&#13;\n<\/pre>\n<p>Save and close the file, when you are finished.<\/p>\n<p>Now, start the Liferay Portal installation by running the following script:<\/p>\n<p class=\"command\">sudo bash \/var\/liferay\/tomcat-8.0.32\/bin\/startup.sh<\/p>\n<p>Wait some time for application to be fully started. You can see the application log using the following command:<\/p>\n<p class=\"command\">tail -f \/var\/liferay\/tomcat-8.0.32\/logs\/catalina.out<\/p>\n<p>Once the application is fully started, open your web browser and type the URL <strong>http:\/\/your-server-ip:8080<\/strong>, you will be redirected to the Liferay Application Portal.<\/p>\n<p>Congratulations! you have successfully installed Liferay Portal on your Debian 9 server.<\/p>\n<div>\n<p><b>Share this page:<\/b><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Liferay is a free and open source content management software written in Java and uses MySQL to store their data. Liferay is a web based application portal that can be used to build websites and portals as an assembly of themes, pages, and a common navigation. Liferay comes with simple and easy to use programming &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-2883","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/2883","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=2883"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/2883\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=2883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=2883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=2883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}