![](https://blogdecomputo.com/wp-content/uploads/2022/08/fea.png)
How to install LAMP on Fedora 29 or Fedora 30?
![fea LAMP on Fedora 29](https://blogdecomputo.com/wp-content/uploads/2022/08/fea-300x126.png)
A LAMP server (Linux + Apache + MariaDB + PHP)
allows us to have a web server ready to host sites made with each of
the components of the acronym. So, this article will teach you how to
install LAMP on Fedora 29 and Fedora 30.
Many web developers use Fedora for their work. It’s not uncommon
because we’re talking about a very stable and carefully made Linux
distribution. However, it is true that Fedora is not the first choice to
install LAMP so many don’t know how to do it.
![Install LAMP on Fedora 29](https://blogdecomputo.com/wp-content/uploads/2022/08/11-300x147.jpg)
A LAMP server as I said before is composed of Linux, a web server as Apache, a database manager in MariaDB and a programming language to interpret and make the application work, in this case, PHP. Together, they form an ideal combination to develop web applications and to run applications.
Let’s start.
Install LAMP on Fedora
1. Install Apache web server
First, you need to install apache web server. It is perhaps the most
used web server in the world. It stands out for its ease of use, its
great documentation and its compatibility with almost all Linux
distributions. In addition, its installation is quite simple. Let’s get
to it.
Open a Terminal and run:
:~# sudo dnf install httpd
![1.- Install apache web server](https://blogdecomputo.com/wp-content/uploads/2022/08/1-2-300x169.png)
Once the installation is complete, you need to start the service and enable it to run at system startup.
:~$ sudo systemctl enable httpd :~$ sudo systemctl start httpd
![2.- Enabling httpd service](https://blogdecomputo.com/wp-content/uploads/2022/08/2-1-300x169.png)
So far there should be no problems, however, if you want to enable
remote access, you have to configure something in the firewall.
:~$ sudo firewall-cmd --permanent --zone=FedoraWorkstation --add-service=http
And finally, restart the Firewall service.
:~$ sudo systemctl restart firewalld
![3.- Restarting the Firewall service](https://blogdecomputo.com/wp-content/uploads/2022/08/3-111-300x169.png)
Next, open the web browser and go to localhost. You will see this:
![Apache default page on Fedora 30](https://blogdecomputo.com/wp-content/uploads/2022/08/rr-300x148.png)
And you can continue with the next step.
3. Install PHP
PHP is another fundamental component of LAMP. Without it, you will
not be able to execute correctly web applications created in this
language. So, it is necessary to install it.
:~$ sudo dnf install php php-cli php-xml php-pdo php-mysqlnd php-pear php-mbstring php-mcrypt
![4.- Installing PHP](https://blogdecomputo.com/wp-content/uploads/2022/08/4-1-300x169.png)
Now it is necessary to test the installation. Create a file named example.php
in /var/www/html/
with the following content.
:~$ sudo vi /var/www/html/example.php
<?php phpinfo(); ?>
5. Creating a PHP file for testRestart apache service.
:~$ sudo systemctl restart httpd
Open a web browser and open it. http://IP_ADDRESS/example.php
and if you see something like this, then everything goes in order.
![6.- PHP installed](https://blogdecomputo.com/wp-content/uploads/2022/08/6-1-300x146.png)
The next step is to install MariaDB.
4. Install MariaDB
Now it’s MariaDB’s turn to install. This is so that the applications
that require database can run. MariaDB is a MySQL fork that inherits its
strength, robustness, and stability.
:~$ sudo dnf install mariadb mariadb-server
![7.- Install MariaDB](https://blogdecomputo.com/wp-content/uploads/2022/08/7-1-300x169.png)
Then, enable the MariaDB service.
:~$ sudo systemctl enable mariadb :~$ sudo systemctl start mariadb
![8.- Enabling MariaDB service](https://blogdecomputo.com/wp-content/uploads/2022/08/8-1-300x169.png)
Now, you have to define a password and some extra settings. For this, you will use the MySQL script.
:~$ sudo mysql_secure_installation
![9.- mysql_secure_installation](https://blogdecomputo.com/wp-content/uploads/2022/08/9-1-300x169.png)
![10.- Configuring MariaDB using mysql_secure_installation](https://blogdecomputo.com/wp-content/uploads/2022/08/10-1-300x169.png)
To the questions that arise, I have answered: Y, N, Y, Y.
And that’s it.
Conclusion
As you may have noticed, installing LAMP is really easy. The key is to do it methodically and everything becomes easy.
The LAMP is necessary for any web developer and for system administrators to be able to run their web applications.
Please spread this article through your social networks.
Fuente: https://www.osradar.com/how-to-install-lamp-on-fedora-29/