{"id":12943,"date":"2019-03-29T03:41:42","date_gmt":"2019-03-29T03:41:42","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=12943"},"modified":"2019-03-29T03:41:42","modified_gmt":"2019-03-29T03:41:42","slug":"how-to-install-lamp-stack-with-phpmyadmin-in-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/29\/how-to-install-lamp-stack-with-phpmyadmin-in-ubuntu-18-04\/","title":{"rendered":"How to Install LAMP Stack with PhpMyAdmin in Ubuntu 18.04"},"content":{"rendered":"<p>A\u00a0<strong>LAMP<\/strong>\u00a0stack is composed of packages such as\u00a0<strong>Apache<\/strong>,\u00a0<strong>MySQL\/MariaDB<\/strong>\u00a0and\u00a0<strong>PHP<\/strong>\u00a0installed on a Linux system environment for hosting websites and apps.<\/p>\n<p><strong>Read Also<\/strong>:\u00a0<a href=\"https:\/\/www.tecmint.com\/install-lamp-with-phpmyadmin-in-ubuntu-18-04\/\" target=\"_blank\" rel=\"noopener\">Install Apache, MariaDB, PHP and PhpMyAdmin in Ubuntu 18.04<\/a><\/p>\n<p><strong>PhpMyAdmin<\/strong>\u00a0is a free, open source, well known, fully-featured, and intuitive web-based frontend for administering\u00a0<strong>MySQL<\/strong>\u00a0and\u00a0<strong>MariaDB<\/strong>\u00a0database. It supports various database operations, and has many features that allow you to easily manage your databases from a web interface; such as importing and exporting data in various formats, generating complex and useful queries using Query-by-example (QBE), administering multiple servers, and much more.<\/p>\n<h4>Requirements:<\/h4>\n<ol>\n<li>Minimal Ubuntu 18.04 server Installation.<\/li>\n<li>Access to server via SSH (if you don\u2019t have direct access).<\/li>\n<li>Root user privileges or use\u00a0<a href=\"https:\/\/www.tecmint.com\/su-vs-sudo-and-how-to-configure-sudo-in-linux\/\" target=\"_blank\" rel=\"noopener\">sudo command<\/a>\u00a0to run all commands.<\/li>\n<\/ol>\n<p>In this article, we will explain how to install\u00a0<strong>LAMP<\/strong>\u00a0stack with\u00a0<strong>PhpMyAdmin<\/strong>\u00a0in\u00a0<strong>Ubuntu 18.04<\/strong>.<\/p>\n<h3>Step 1: Install Apache Web Server on Ubuntu 18.04<\/h3>\n<p><strong>1.<\/strong>\u00a0First start by updating your software packages and then install\u00a0<strong>Apache<\/strong>\u00a0web server using following commands.<\/p>\n<pre>$ sudo apt update\r\n$ sudo apt install apache2\r\n<\/pre>\n<p><strong>2.<\/strong>\u00a0After the installation process is complete, the apache service should start automatically and will be enabled to start at system boot time, you can check if it\u2019s up and running using following command.<\/p>\n<pre>$ sudo systemctl status apache2\r\n<\/pre>\n<p><strong>3.<\/strong>\u00a0If you have a system firewall enabled and running, you need to open the ports\u00a0<strong>80<\/strong>\u00a0and\u00a0<strong>443<\/strong>\u00a0to allow client connection requests to apache web server via\u00a0<strong>HTTP<\/strong>\u00a0and\u00a0<strong>HTTPS<\/strong>\u00a0respectively, then reload the firewall settings as shown.<\/p>\n<pre>$ sudo ufw allow 80\/tcp\r\n$ sudo ufw allow 443\/tcp\r\n$ sudo ufw reload\r\n<\/pre>\n<p><strong>4.<\/strong>\u00a0Now verify your Apache installation by testing default test page at the below URL from a web browser.<\/p>\n<pre>http:\/\/domain_name\/\r\nOR\r\nhttp:\/\/SERVER_IP\/\r\n<\/pre>\n<p>If you see the apache default web page, it means your installation is working fine.<\/p>\n<div id=\"attachment_29781\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Check-Apache-Web-Page.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29781\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Check-Apache-Web-Page.png\" alt=\"Check Apache Web Page\" width=\"755\" height=\"655\" aria-describedby=\"caption-attachment-29781\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29781\" class=\"wp-caption-text\">Check Apache Web Page<\/p>\n<\/div>\n<h3>Step 2: Install MariaDB on Ubuntu 18.04<\/h3>\n<p><strong>5.<\/strong>\u00a0Now install\u00a0<strong>MariaDB<\/strong>, is a free, open source database management system forked from\u00a0<strong>MySQL<\/strong>\u00a0and it is a community developed project being led by the original developers of\u00a0<strong>MySQL<\/strong>.<\/p>\n<pre>$ sudo apt install mariadb-server mariadb-client\r\n<\/pre>\n<p><strong>6.<\/strong>\u00a0The\u00a0<strong>MariaDB<\/strong>\u00a0services should start automatically after installation, check its status to ensure that it is up and running.<\/p>\n<pre>$ sudo systemctl status mysql\r\n<\/pre>\n<p><strong>7.<\/strong>\u00a0The\u00a0<strong>MariaDB<\/strong>\u00a0installation is not secure by default, you need to execute a security script that comes with the package. You will be asked to set a\u00a0<strong>root password<\/strong>\u00a0to ensure that nobody can log into the MariaDB.<\/p>\n<pre>$ sudo mysql_secure_installation\r\n<\/pre>\n<p>Once you execute the script, it will ask you to enter current password for root (<strong>enter for none<\/strong>):<\/p>\n<p>Then enter\u00a0<code>yes\/y<\/code>\u00a0to the following security questions:<\/p>\n<ul>\n<li>Set root password? [Y\/n]:\u00a0<code>y<\/code><\/li>\n<li>Remove anonymous users? (Press y|Y for Yes, any other key for No) :\u00a0<code>y<\/code><\/li>\n<li>Disallow root login remotely? (Press y|Y for Yes, any other key for No) :\u00a0<code>y<\/code><\/li>\n<li>Remove test database and access to it? (Press y|Y for Yes, any other key for No) :\u00a0<code>y<\/code><\/li>\n<li>Reload privilege tables now? (Press y|Y for Yes, any other key for No) :\u00a0<code>y<\/code><\/li>\n<\/ul>\n<div id=\"attachment_29782\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Secure-Mariadb-Installation.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29782\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Secure-Mariadb-Installation.png\" alt=\"Secure Mariadb Installation in Ubuntu 18.04\" width=\"604\" height=\"678\" aria-describedby=\"caption-attachment-29782\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29782\" class=\"wp-caption-text\">Secure Mariadb Installation in Ubuntu 18.04<\/p>\n<\/div>\n<h3>Step 3: Install PHP on Ubuntu 18.04<\/h3>\n<p><strong>8.<\/strong>\u00a0<strong>PHP<\/strong>\u00a0is one of the most widely used server side scripting language used to generate dynamic content on websites and apps. You can install\u00a0<strong>PHP<\/strong>\u00a0(default version is\u00a0<strong>PHP 7.2<\/strong>) and other modules for web deployments using following command.<\/p>\n<pre>$ sudo apt install php php-common php-mysql php-gd php-cli<\/pre>\n<p><strong>9.<\/strong>\u00a0Once PHP installed, you can test your PHP setup by creating a simple\u00a0<code>info.php<\/code>\u00a0page in your web server document root, using this single command.<\/p>\n<pre> \r\n$ echo \"&lt;?php phpinfo(); ?&gt;\" | sudo tee \/var\/www\/html\/info.php\r\n<\/pre>\n<p><strong>10.<\/strong>\u00a0Then open a web browser, and enter this URL to view the php information page.<\/p>\n<pre>http:\/\/domain_name\/info.php\r\nOR\r\nhttp:\/\/SERVER_IP\/info.php\r\n<\/pre>\n<div id=\"attachment_29783\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Test-PHP-Info.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29783\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Test-PHP-Info.png\" alt=\"Test PHP Info in Ubuntu 18.04\" width=\"755\" height=\"655\" aria-describedby=\"caption-attachment-29783\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29783\" class=\"wp-caption-text\">Test PHP Info in Ubuntu 18.04<\/p>\n<\/div>\n<h3>Step 4: Install PhpMyAdmin on Ubuntu 18.04<\/h3>\n<p><strong>11.<\/strong>\u00a0Finally, you can install\u00a0<strong>phpMyAdmin<\/strong>\u00a0for administrating\u00a0<strong>MySQL\/MariaDB<\/strong>\u00a0databases from the comfort of a web browser, by running following command.<\/p>\n<pre>$ sudo apt install phpmyadmin\r\n<\/pre>\n<p>Through the package installation process, you will be asked to choose the web server that should be automatically configured to run phpMyAdmin, select\u00a0<strong>apache<\/strong>\u00a0by pressing the space bar and press\u00a0<strong>Enter<\/strong>.<\/p>\n<div id=\"attachment_29785\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Select-PhpMyAdmin-Web-Server.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29785\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Select-PhpMyAdmin-Web-Server.png\" sizes=\"auto, (max-width: 852px) 100vw, 852px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Select-PhpMyAdmin-Web-Server.png 852w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Select-PhpMyAdmin-Web-Server-768x447.png 768w\" alt=\"Select PhpMyAdmin Web Server\" width=\"852\" height=\"496\" aria-describedby=\"caption-attachment-29785\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29785\" class=\"wp-caption-text\">Select PhpMyAdmin Web Server<\/p>\n<\/div>\n<div id=\"attachment_29784\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/PhpMyAdmin-Configuration.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29784\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/PhpMyAdmin-Configuration.png\" sizes=\"auto, (max-width: 822px) 100vw, 822px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/PhpMyAdmin-Configuration.png 822w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/PhpMyAdmin-Configuration-768x357.png 768w\" alt=\"PhpMyAdmin Configuration\" width=\"822\" height=\"382\" aria-describedby=\"caption-attachment-29784\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29784\" class=\"wp-caption-text\">PhpMyAdmin Configuration<\/p>\n<\/div>\n<p><strong>12.<\/strong>\u00a0Next, enter the password for the\u00a0<strong>MySQL\/MariaDB<\/strong>\u00a0administrative user so the installer can create database for phpmyadmin.<\/p>\n<div id=\"attachment_29786\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Set-Password-for-Phpmyadmin.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29786\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Set-Password-for-Phpmyadmin.png\" sizes=\"auto, (max-width: 822px) 100vw, 822px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Set-Password-for-Phpmyadmin.png 822w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Set-Password-for-Phpmyadmin-768x357.png 768w\" alt=\"Set Password for Phpmyadmin\" width=\"822\" height=\"382\" aria-describedby=\"caption-attachment-29786\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29786\" class=\"wp-caption-text\">Set Password for Phpmyadmin<\/p>\n<\/div>\n<p><strong>13.<\/strong>\u00a0Once everything installed, you can now restart the apache2 service to effect the recent changes.<\/p>\n<pre>$ sudo systemctl restart apache2\r\n<\/pre>\n<p><strong>Note<\/strong>: If the\u00a0<strong>PhpMyAdmin<\/strong>\u00a0package has not been enable to work with apache web server automatically, run the following commands to copy the phpmyadmin apache configuration file located under\u00a0<strong>\/etc\/phpmyadmin\/<\/strong>\u00a0to apache webserver available configurations directory\u00a0<strong>\/etc\/apache2\/conf-available\/<\/strong>\u00a0and then activate it using the\u00a0<strong>a2enconf<\/strong>\u00a0utility, and restart apache service effect the recent changes, as follows.<\/p>\n<pre>$ sudo cp \/etc\/phpmyadmin\/apache.conf \/etc\/apache2\/conf-available\/phpmyadmin.conf \r\n$ sudo a2enconf phpmyadmin\r\n$ sudo systemctl restart apache2<\/pre>\n<p><strong>14.<\/strong>\u00a0Lastly, from a web browser, and type the following URL to access you phpMyAdmin web frontend.<\/p>\n<pre>http:\/\/domain_name\/phpmyadmin\r\nOR\r\nhttp:\/\/SERVER_IP\/phpmyadmin\r\n<\/pre>\n<p>Use the\u00a0<strong>root<\/strong>\u00a0credentials to authenticate in the phpMyAdmin, as shown in the following screen shot.<\/p>\n<div id=\"attachment_29787\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/PhpMyAdmin-Login.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29787\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/PhpMyAdmin-Login.png\" alt=\"PhpMyAdmin Login\" width=\"748\" height=\"647\" aria-describedby=\"caption-attachment-29787\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29787\" class=\"wp-caption-text\">PhpMyAdmin Login<\/p>\n<\/div>\n<p><strong>Important<\/strong>: Starting from\u00a0<strong>MySQL 5.7<\/strong>, root login requires\u00a0<strong>sudo command<\/strong>, therefore the root login will fail via phpmyadmin, you may need to create another admin user account. Access the mariadb shell using the root account from a terminal, and run the following commands to create a new user:<\/p>\n<pre>$ sudo mysql -u root -p\r\n<\/pre>\n<pre>MariaDB [(none)]&gt; CREATE USER '<strong>admin<\/strong>'@'localhost' IDENTIFIED BY '<strong>=@!#254tecmint<\/strong>';\r\nMariaDB [(none)]&gt; GRANT ALL PRIVILEGES ON *.* TO '<strong>admin<\/strong>'@'localhost' WITH GRANT OPTION;\r\nMariaDB [(none)]&gt; FLUSH PRIVILEGES;\r\n<\/pre>\n<p>Now log into\u00a0<strong>PhpMyAdmin<\/strong>\u00a0using the new\u00a0<strong>admin<\/strong>\u00a0credentials to administer your databases.<\/p>\n<div id=\"attachment_29788\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/PhpMyAdmin-MySQL-Database-Administration.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29788\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/PhpMyAdmin-MySQL-Database-Administration.png\" sizes=\"auto, (max-width: 1045px) 100vw, 1045px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/PhpMyAdmin-MySQL-Database-Administration.png 1045w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/PhpMyAdmin-MySQL-Database-Administration-768x518.png 768w\" alt=\"PhpMyAdmin MySQL Database Administration\" width=\"1045\" height=\"705\" aria-describedby=\"caption-attachment-29788\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29788\" class=\"wp-caption-text\">PhpMyAdmin MySQL Database Administration<\/p>\n<\/div>\n<p>To secure your PhpMyAdmin web interface, check this article:\u00a0<a href=\"https:\/\/www.tecmint.com\/secure-phpmyadmin-centos-ubuntu\/\" target=\"_blank\" rel=\"noopener\">4 Useful Tips to Secure PhpMyAdmin Web Interface<\/a>.<\/p>\n<p>That\u2019s it! In this article, we have explained how to setup\u00a0<strong>LAMP<\/strong>\u00a0stack with the latest\u00a0<strong>PhpMyAdmin<\/strong>\u00a0in\u00a0<strong>Ubuntu 18.04<\/strong>. Use the comment form below to send us your queries, or thoughts about this guide.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/install-lamp-with-phpmyadmin-in-ubuntu-18-04\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A\u00a0LAMP\u00a0stack is composed of packages such as\u00a0Apache,\u00a0MySQL\/MariaDB\u00a0and\u00a0PHP\u00a0installed on a Linux system environment for hosting websites and apps. Read Also:\u00a0Install Apache, MariaDB, PHP and PhpMyAdmin in Ubuntu 18.04 PhpMyAdmin\u00a0is a free, open source, well known, fully-featured, and intuitive web-based frontend for administering\u00a0MySQL\u00a0and\u00a0MariaDB\u00a0database. It supports various database operations, and has many features that allow you to easily &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/29\/how-to-install-lamp-stack-with-phpmyadmin-in-ubuntu-18-04\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Install LAMP Stack with PhpMyAdmin in Ubuntu 18.04&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12943","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=12943"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12943\/revisions"}],"predecessor-version":[{"id":12944,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12943\/revisions\/12944"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=12943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=12943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=12943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}