Despite the fact that in the Desktop world there are several Gnu / Linux distributions and very varied, the same does not happen in the Server world and only a little of these stand out or are used to manage the servers that move the web pages and various web applications .
One of the most popular distributions in the server world is Ubuntu Server, an official version of Ubuntu that is intended for servers and computers that will be used for this purpose. But, unfortunately, such a distribution does not come with the LAMP server activated, a simple process that we are going to tell you how to do.First we have to say that LAMP stands for Linux Apache MariaDB (MySql) and PHP. So installing a LAMP server is essentially installing all that software and in the same order of the acronyms. Thus, the first thing we have to do is install Apache. We will do this by executing the following command in the terminal:
sudo apt-get install apache2
After installing it, We can check that it works by typing in the web browser the address http: // localhost / and something like the following will appear:
Now we have to install the database that in this case we will use MariaDB. MariaDB is a fork of MySql so it works anyway but it's free while MySql belongs to Oracle. Installation is also very simple. We have to execute the following commands in the terminal:
sudo apt install mariadb-server mariadb-client
If we have a version prior to Ubuntu 18.04, the most common even for many servers, then we have to execute this before:
sudo apt-get install software-properties-common sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://sgp1.mirrors.digitalocean.com/mariadb/repo/10.3/ubuntu bionic main'
And then we have to execute the following:
sudo apt-get update sudo apt-get install mariadb-server
We do this with all versions prior to Ubuntu 18.04 because they have an old version of MariaDB while Ubuntu 18.04 has a current version and running the above lines involves installing a modern version of MariaDB.
Now that we have the database we have to continue with the PHP language. In this case we have to execute the following command:
sudo apt-get install php libapache2-mod-php php-mysql
And after this we will have the LAMP server ready and working. But only in a basic way. If we want to install it on a production server we have to take into account the firewall and the modules. This is, In the Firewall we have to open ports 80 and 443. And if we want advanced PHP functions, then we have to install modules. But that will depend on the needs of each one. In any case, with this we can have a basic and homemade LAMP server that can be used for domestic use.