Ubuntu 20.04 installed? Turn it into a LAMP

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

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

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

Depois de instalarmos e configuramos o Apache, vamos agora avançar para o sistema de gestão de base de dados mySQL e também para o PHP.

Instalar e configurar o mySQL no Ubuntu

O MySQL é muito provavelmente o sistema de gestão de base de dados (SGBD) mais usado em todo o mundo estando disponível em várias versões e para diferentes sistemas operativos. Tudo o que são plataformas open source como é o caso do WordPress, Joomla ou Drupal, recorrem ao MySQL como base de dados.

Para proceder à instalação do MySQL no Ubuntu e derivados devem abrir o terminal e inserir o seguinte comando

sudo apt install mysql-server

sudo apt install mysql-server

Then they must execute command sudo mysql_secure_installation which will define security parameters in the database management system. Choose a password to access mySQL, remove users and test databases, etc.

Install PHP

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

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

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

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

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

That’s all for today! In a next tutorial we will teach you how to have multiple sites on a single server and with personalized names. Watch out! If you have any suggestions for tutorials on Ubuntu, leave them in the comments.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.