Install and configure Apache2, MySQL, PHP and phpMyAdmin on ubuntu


The Apache HTTP server is one the most widely-used web server on the planet. It offers many powerful features including dynamically loadable modules, robust media support, and extensive integration with other popular software. For more details visit apache official website here.

MySQL is the most prominent, open source relational database management system (RDBMS) and perfect for both tiny and big applications. For more details visit MySQL official website here.

phpMyAdmin is a cost-free software tool written in PHP, meant to take care of the management of MySQL over the web. phpMyAdmin supports a vast array of operations on MySQL and MariaDB. Frequently used operations (managing databases, tables, columns, relations, indexes, users, permissions, etc) can be performed via the user interface, while you still have the ability to directly execute any SQL statement. For more details visit phpMyAdmin official website here.

There are 5 steps to install and configure apache2, phpMyAdmin, MySQL.

1. Update package list:

To install the latest version of software update the package list.

sudo apt-get update

2. Install apache2:

To install apache2 run the following command, Press Y and hit Enter when asked Do you want to continue?

sudo apt-get install apache2

Hit http://localhost/ in your browser and you will see apache2 ubuntu default page.

3. Install MySQL:

Now we have installed apache2 web server. Now it's time to install MySQL. To install MySQL server run the following command-

sudo apt-get install mysql-server

press Y for continue. Also, set the password for root user when asked.

4. Install PHP:

Now install PHP using the command-

sudo apt-get install php libapache2-mod-php

5. Install phpMyAdmin:

To install phpMyAdmin run the following command-

sudo apt-get install phpmyadmin

Now we have installed all the packages required and now need to restart apache service. Run the following command to restart apache service-

sudo service apache2 restart

and hit http://localhost/phpmyadmin/ in your browser. If everything goes right you will see phpMyAdmin welcome page-

Note:- If an error occurred saying The requested URL /phpmyadmin was not found on this server. Then follow these step to fix it-

i) Open apache2.conf file-

sudo -H gedit /etc/apache2/apache2.conf

ii) Add the following line to the end of the file and save-

Include /etc/phpmyadmin/apache.conf

iii) Restart apache server-

sudo service apache2 restart

Congratulations you have just installed and configured Apache2, MySQL, and phpMyAdmin. Wish you all the best. If you have encountered any problem leave a comment.


Join us for latest updates and blog posts

Recent Posts







RSS / Atom