0% found this document useful (0 votes)
22 views13 pages

How To Install LAMP Stack With PhpMyAdmin in Ubuntu 18.04

The document explains how to install LAMP stack with PhpMyAdmin on Ubuntu 18.04 in 4 steps: installing Apache, MariaDB, PHP, and PhpMyAdmin. The process involves updating packages, setting passwords, testing installations, and configuring the components to work together.

Uploaded by

Roberto Estrada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views13 pages

How To Install LAMP Stack With PhpMyAdmin in Ubuntu 18.04

The document explains how to install LAMP stack with PhpMyAdmin on Ubuntu 18.04 in 4 steps: installing Apache, MariaDB, PHP, and PhpMyAdmin. The process involves updating packages, setting passwords, testing installations, and configuring the components to work together.

Uploaded by

Roberto Estrada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

28/7/2019 How to Install LAMP Stack with PhpMyAdmin in Ubuntu 18.

04

Consulta destinos participantes.

How to Install LAMP Stack with


PhpMyAdmin in Ubuntu 18.04
by Aaron Kili | Published: June 15, 2018 | Last Updated: June 18, 2018

60 Commands of Linux : A Guide from Newbies to System Administrator


https://www.tecmint.com/install-lamp-with-phpmyadmin-in-ubuntu-18-04/ 1/13
28/7/2019 How to Install LAMP Stack with PhpMyAdmin in Ubuntu 18.04

SPONSORED SEARCHES

ubuntu linux

remote screen share

 Download Your Free eBooks NOW - 10 Free Linux eBooks for Administrators | 4
Free Shell Scripting eBooks

A LAMP stack is composed of packages such as Apache,


MySQL/MariaDB and PHP installed on a Linux system
environment for hosting websites and apps.

Read Also: Install Apache, MariaDB, PHP and PhpMyAdmin


in Ubuntu 18.04

PhpMyAdmin is a free, open source, well known, fully-


featured, and intuitive web-based frontend for administering
MySQL and MariaDB database. 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.

Requirements:
Minimal Ubuntu 18.04 server Installation.
Access to server via SSH (if you don’t have direct
access).
Root user privileges or use sudo command to run all
commands.

In this article, we will explain how to install LAMP stack with


PhpMyAdmin in Ubuntu 18.04.

Step 1: Install Apache Web Server on


Ubuntu 18.0460 Commands of Linux : A Guide from Newbies to System Administrator
https://www.tecmint.com/install-lamp-with-phpmyadmin-in-ubuntu-18-04/ 2/13
28/7/2019 How to Install LAMP Stack with PhpMyAdmin in Ubuntu 18.04

1. First start by updating your software packages and then


install Apache web server using following commands.

$ sudo apt update


$ sudo apt install apache2

2. After 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’s up and
running using following command.

$ sudo systemctl status apache2

3. If you have a system rewall enabled and running, you


need to open the ports 80 and 443 to allow client connection
requests to apache web server via HTTP and HTTPS
respectively, then reload the rewall settings as shown.

$ sudo ufw allow 80/tcp


$ sudo ufw allow 443/tcp
$ sudo ufw reload

60 Commands of Linux : A Guide from Newbies to System Administrator


https://www.tecmint.com/install-lamp-with-phpmyadmin-in-ubuntu-18-04/ 3/13
28/7/2019 How to Install LAMP Stack with PhpMyAdmin in Ubuntu 18.04

Máquina C
Ad Compon
Resonador I

Bodor® Laser

Más inform

4. Now verify your Apache installation by testing default test


page at the below URL from a web browser.

http://domain_name/
OR
http://SERVER_IP/

If you see the apache default web page, it means your


installation is working ne.

Check Apache Web Page

60 Commands of Linux : A Guide from Newbies to System Administrator


https://www.tecmint.com/install-lamp-with-phpmyadmin-in-ubuntu-18-04/ 4/13
28/7/2019 How to Install LAMP Stack with PhpMyAdmin in Ubuntu 18.04

Step 2: Install MariaDB on Ubuntu


18.04
5. Now install MariaDB, is a free, open source database
management system forked from MySQL and it is a
community developed project being led by the original
developers of MySQL.

$ sudo apt install mariadb-server mar

6. The MariaDB services should start automatically after


installation, check its status to ensure that it is up and
running.

$ sudo systemctl status mysql

7. The MariaDB installation is not secure by default, you


need to execute a security script that comes with the
package. You will be asked to set a root password to ensure
that nobody can log into the MariaDB.

$ sudo mysql_secure_installation

Once you execute the script, it will ask you to enter current
password for root (enter for none):

Then enter yes/y to the following security questions:

Set root password? [Y/n]: y


Remove anonymous users? (Press y|Y for Yes, any other
key for No) : y
60 Commands of Linux : A Guide from Newbies to System Administrator
https://www.tecmint.com/install-lamp-with-phpmyadmin-in-ubuntu-18-04/ 5/13
28/7/2019 How to Install LAMP Stack with PhpMyAdmin in Ubuntu 18.04

Disallow root login remotely? (Press y|Y for Yes, any


other key for No) : y
Remove test database and access to it? (Press y|Y for
Yes, any other key for No) : y
Reload privilege tables now? (Press y|Y for Yes, any
other key for No) : y

Secure Mariadb Installation in Ubuntu 18.04

Step 3: Install PHP on Ubuntu 18.04


8. PHP is one of the most widely used server side scripting
language used to generate dynamic content on websites and
apps. You can install PHP (default version is PHP 7.2) and
other modules for web deployments using following
command.

60 Commands of Linux : A Guide from Newbies to System Administrator


https://www.tecmint.com/install-lamp-with-phpmyadmin-in-ubuntu-18-04/ 6/13
28/7/2019 How to Install LAMP Stack with PhpMyAdmin in Ubuntu 18.04

$ sudo apt install php php-common php

La Cocina

Ad 25 Años

Cocinas Interi

Saber má

9. Once PHP installed, you can test your PHP setup by


creating a simple info.php page in your web server
document root, using this single command.

$ echo "<?php phpinfo(); ?>" | sudo t

10. Then open a web browser, and enter this URL to view the
php information page.

http://domain_name/info.php
OR
http://SERVER_IP/info.php

60 Commands of Linux : A Guide from Newbies to System Administrator


https://www.tecmint.com/install-lamp-with-phpmyadmin-in-ubuntu-18-04/ 7/13
28/7/2019 How to Install LAMP Stack with PhpMyAdmin in Ubuntu 18.04

Test PHP Info in Ubuntu 18.04

Step 4: Install PhpMyAdmin on


Ubuntu 18.04
11. Finally, you can install phpMyAdmin for administrating
MySQL/MariaDB databases from the comfort of a web
browser, by running following command.

$ sudo apt install phpmyadmin

Through the package installation process, you will be asked


to choose the web server that should be automatically
con gured to run phpMyAdmin, select apache by pressing
the space bar and press Enter.

60 Commands of Linux : A Guide from Newbies to System Administrator


https://www.tecmint.com/install-lamp-with-phpmyadmin-in-ubuntu-18-04/ 8/13
28/7/2019 How to Install LAMP Stack with PhpMyAdmin in Ubuntu 18.04

Select PhpMyAdmin Web Server

PhpMyAdmin Con guration

12. Next, enter the password for the MySQL/MariaDB


administrative user so the installer can create database for
phpmyadmin.

Set Password for Phpmyadmin

60 Commands of Linux : A Guide from Newbies to System Administrator


https://www.tecmint.com/install-lamp-with-phpmyadmin-in-ubuntu-18-04/ 9/13
28/7/2019 How to Install LAMP Stack with PhpMyAdmin in Ubuntu 18.04

13. Once everything installed, you can now restart the


apache2 service to effect the recent changes.

$ sudo systemctl restart apache2

Note: If the PhpMyAdmin package has not been enable to


work with apache web server automatically, run the following
commands to copy the phpmyadmin apache con guration
le located under /etc/phpmyadmin/ to apache webserver
available con gurations directory /etc/apache2/conf-
available/ and then activate it using the a2enconf utility, and
restart apache service effect the recent changes, as follows.

$ sudo cp /etc/phpmyadmin/apache.conf
$ sudo a2enconf phpmyadmin
$ sudo systemctl restart apache2

14. Lastly, from a web browser, and type the following URL to
access you phpMyAdmin web frontend.

http://domain_name/phpmyadmin
OR
http://SERVER_IP/phpmyadmin

60 Commands of Linux : A Guide from Newbies to System Administrator


https://www.tecmint.com/install-lamp-with-phpmyadmin-in-ubuntu-18-04/ 10/13
28/7/2019 How to Install LAMP Stack with PhpMyAdmin in Ubuntu 18.04

Use the root credentials to authenticate in the phpMyAdmin,


as shown in the following screen shot.

PhpMyAdmin Login

Important: Starting from MySQL 5.7, root login requires sudo


command, 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:

$ sudo mysql -u root -p

MariaDB [(none)]> CREATE USER 'admin'@


MariaDB [(none)]> GRANT ALL PRIVILEGE
MariaDB [(none)]> FLUSH PRIVILEGES;

Now log into PhpMyAdmin using the new admin credentials


to administer your databases.
60 Commands of Linux : A Guide from Newbies to System Administrator
https://www.tecmint.com/install-lamp-with-phpmyadmin-in-ubuntu-18-04/ 11/13
28/7/2019 How to Install LAMP Stack with PhpMyAdmin in Ubuntu 18.04

PhpMyAdmin MySQL Database Administration

To secure your PhpMyAdmin web interface, check this


article: 4 Useful Tips to Secure PhpMyAdmin Web Interface.

That’s it! In this article, we have explained how to setup


LAMP stack with the latest PhpMyAdmin in Ubuntu 18.04.
Use the comment form below to send us your queries, or
thoughts about this guide.

Best Affordable Linux and WordPress Services For Your Business


Outsource Your Linux and WordPress Project and Get it Promptly Completed
Remotely and Delivered Online.

Tags: phpmyadmin Ubuntu 18.04

Aaron Kili View all Posts


Aaron Kili is a Linux and F.O.S.S enthusiast, an

upcoming Linux SysAdmin, web developer, and currently a
content creator for TecMint who loves working with computers
and strongly believes in sharing knowledge.

Your name can also be listed here. Got a tip?


Submit it here to become an TecMint author.
60 Commands of Linux : A Guide from Newbies to System Administrator
https://www.tecmint.com/install-lamp-with-phpmyadmin-in-ubuntu-18-04/ 12/13
28/7/2019 How to Install LAMP Stack with PhpMyAdmin in Ubuntu 18.04

60 Commands of Linux : A Guide from Newbies to System Administrator


https://www.tecmint.com/install-lamp-with-phpmyadmin-in-ubuntu-18-04/ 13/13

You might also like