Install LAMP Server in Ubuntu 20.04 LTS through tasksel

LAMP is an acronym for Linux Operating System, Apache HTTP Server, MySQL and PHP. It is basically a web application server. In this article, we would discuss how to install LAMP Server in Ubuntu 20.04 LTS release.

Although we can install all the components of LAMP separately. But, we consider installing LAMP server through tasksel package less tasking. As the package tasksel intends to install multiple related packages as one. So, all we need to do – install tasksel package and thereafter install LAMP Server.

Note: Following operations would require you to have superuser privileges. In case you don’t have one, then contact your System Administrator.

Install tasksel in Ubuntu 20.04 LTS

In case you don’t have the package installed, then to install tasksel first update the standard Ubuntu repository. It will help us get the latest version of the package available. So, issue the following in terminal –

sudo apt update

Next, to install tasksel package –

sudo apt install tasksel

It will take care of necessary dependencies as well.

Install LAMP Server through tasksel in Ubuntu 20.04 LTS release

As already discussed, we don’t have to install the packages individually for LAMP Server. Just issue following command in terminal –

sudo tasksel install lamp-server

All packages required to setup LAMP will be installed.

Thereafter, open a web browser and type the following in address bar –

http://localhost/

it will show us a Apache2 Ubuntu default page which means Apache2 is working as intended.

To test for PHP as well. We would have to create a index.php file in /var/www/html. It the default (DocumentRoot) directory in Apache configuration. We have used nano text-editor to create and edit the file –

sudo nano /var/www/html/index.php

And, add following entries in it –

phpinfo

Now, type the following in web browsers’ address bar –

http://localhost/index.php

phpinfo() – provides us the information about current state of PHP. If we get PHP page wherein all the current state of PHP is being available then PHP is working as well.

Finally, to secure MySQL installation –

sudo mysql_secure_installation

It will ask us to Validate Password – Press y and thereafter, set password validation policy. Thereafter, choose options as per your requirement.

In conclusion, we have discussed how to install LAMP Server in Ubuntu 20.04 LTS through tasksel package.