Installing the Apache Web Server on Linux systems like Ubuntu, Fedora, and RHEL is an easy task if you adhere to the proper procedures. After installing Apache, you can utilize its robust capabilities to efficiently host and control your websites. It's essential to perform routine upkeep and updates to maintain the security and efficiency of your Apache server. This article equips you with the necessary understanding to install and configure Apache on your Linux machine, making it simpler to deploy and manage web applications.

$ sudo apt update
$ sudo apt install apache2 mariadb-server mariadb-client python3

To install Apache, MySQL, and Python on Fedora, CentOS, AlmaLinux, Red Hat, and Rocky Linux:

$ sudo dnf install httpd mariadb-server python3

Configure MySQL

One of the first things we should do is get our WordPress database ready. In order to do that, we first need to do some initial configuration of MySQL. To get started, execute the following command in terminal:

$ sudo mysql_secure_installation

Leave the first response blank and press enter. You should reply with y (yes) to the rest of the prompts, and configure a root password when prompted to do so. This setup only takes a moment to complete.

The initial setup of MySQL with mysql_secure_installation
The initial setup of MySQL with mysql_secure_installation