Skip to main content

How to Install Apache HTTP Server on Fedora

Apache HTTP Server is a popular open-source web server that is widely used for hosting websites and web applications. It is a reliable, flexible, and secure web server that is compatible with most operating systems, including Fedora. In this tutorial, we will guide you through the process of installing Apache HTTP Server on Fedora.

Prerequisites

Before we begin the installation, ensure that you have the following:

  • A Fedora system with root or sudo access
  • An active internet connection

Step 1: Update Package Repository

The first step is to update the package repository to ensure that we have the latest packages and dependencies. Open the terminal and run the following command:

sudo dnf update

This command will update the package repository and install any available updates.

Step 2: Install Apache HTTP Server

After updating the package repository, we can now proceed to install Apache HTTP Server. Run the following command in the terminal:

sudo dnf install httpd

This command will install Apache HTTP Server and its dependencies. During the installation, you will be prompted to confirm the installation by typing "y" and then press "Enter."

Step 3: Start Apache HTTP Server

Once the installation is complete, we can start Apache HTTP Server. Run the following command:

sudo systemctl start httpd

This command will start Apache HTTP Server and make it available for use. To confirm that the server is running, run the following command:

sudo systemctl status httpd

This command will display the status of Apache HTTP Server and show whether it is running or not.

Step 4: Configure Firewall

By default, Fedora comes with a firewall that may block incoming traffic to Apache HTTP Server. To allow traffic to the server, we need to configure the firewall. Run the following command:

sudo firewall-cmd --add-service=http --permanent
sudo firewall-cmd --reload

This command will open the HTTP port on the firewall and make it available for incoming traffic.

Step 5: Test Apache HTTP Server

After configuring the firewall, we can now test Apache HTTP Server by opening a web browser and typing the server's IP address or domain name. If everything is configured correctly, you should see the default Apache HTTP Server page.

Step 6: Enable Apache HTTP Server on Boot

To ensure that Apache HTTP Server starts automatically when the system boots, run the following command:

sudo systemctl enable httpd

This command will enable Apache HTTP Server on boot, and it will start automatically when the system reboots.

Conclusion

Congratulations! You have successfully installed Apache HTTP Server on Fedora. Apache HTTP Server is a reliable and secure web server that can host websites and web applications. By following this tutorial, you can easily install and configure Apache HTTP Server on your Fedora system. Remember to always keep your server updated and secure.