Home Linux Ubuntu 20.04 installed? Turn it into a LAMP (Linux, Apache, MySQL and PHP)

bannerebay

Ubuntu 20.04 installed? Turn it into a LAMP (Linux, Apache, MySQL and PHP)

by ace
Ubuntu 20.04 installed? Turn it into a LAMP (Linux, Apache, MySQL and PHP)

Already have Ubuntu open? In Pplware we already offer several articles that teach how to turn a Linux machine into a LAMP server (Linux + Apache + MySQL + PHP). Basically a LAMP is a set of services about Linux, which allow us to create a real Web server (Apache2 – to put content online such as websites, platforms such as WordPress, Joomla, wikis, etc.) with support for the PHP programming language and for the MySQL database service.

In one of the last tutorials we taught you how to install Apache. Today we will install MySQL and PHP.

After we install and configure Apache, we will now move on to the mySQL database management system and also to PHP.

Install and configure mySQL on Ubuntu

MySQL is most likely the most widely used database management system (DBMS) in the world and is available in various versions and for different operating systems. All that are open source platforms such as WordPress, Joomla or Drupal, use MySQL as a database.

To install MySQL in Ubuntu and derivatives must open the terminal and enter the following command

sudo apt install mysql-server

Ubuntu 20.04 installed? Turn it into a LAMP (Linux, Apache, MySQL and PHP)

They should then run sudo command mysql_secure_installation which will set security parameters in the database management system. Choose a mySQL access password, remove users and test databases, etc.

Ubuntu 20.04 installed? Turn it into a LAMP (Linux, Apache, MySQL and PHP)

Install PHP

We will now install PHP on Ubuntu and support for Apache and MySQL. Like installing Apache and MySQL, we will also use a command for php installation. To do this, simply execute the following command on the terminal:

sudo apt install php libapache2-mod-php php-mysql

Ubuntu 20.04 installed? Turn it into a LAMP (Linux, Apache, MySQL and PHP)

And it’s done! We have the server ready and to see if everything is okay we can create a page (in /var/www/html) with the following code.   Then just record as the name, for example, info.php.

Ubuntu 20.04 installed? Turn it into a LAMP (Linux, Apache, MySQL and PHP)

If everything is operational you should see a page identical to the one shown in the following image.

Ubuntu 20.04 installed? Turn it into a LAMP (Linux, Apache, MySQL and PHP)

That’s all for today! In a next tutorial we will teach you how to have multiple sites on a single server and with custom names. Keep your eyes open! If you have any suggestions for tutorials in Ubuntu leave in the comments.

bannerebay

Related Articles

Leave a Comment

19 − 15 =

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More