How to Install Apache on Fedora Server Latest
Apache is one of the most widely used web servers in the world. It is a free and open-source cross-platform web server software that powers over 40% of websites today. In this tutorial, we will learn how to install Apache on Fedora Server Latest.
Prerequisites
- A Fedora Server Latest instance with a non-root user account with sudo privileges.
Step 1 - Update the System
Before starting with the installation, update the system using the following command:
sudo dnf update -y
Step 2 - Install Apache
To install Apache on Fedora, run the following command:
sudo dnf install httpd -y
This command will install the Apache web server on your Fedora system.
Step 3 - Start Apache
After the installation is complete, start the Apache web server by running the following command:
sudo systemctl start httpd
To verify that Apache is running, enter the following command:
sudo systemctl status httpd
This will display the status of Apache; if Apache is running, you should see an output similar to the following:
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2022-04-25 14:40:46 IST; 28s ago
Docs: man:httpd.service(8)
Process: 2195 ExecStart=/usr/sbin/httpd -DFOREGROUND (code=exited, status=0/SUCCESS)
Main PID: 2196 (httpd)
Tasks: 213 (limit: 11507)
Memory: 19.5M
CPU: 330ms
CGroup: /system.slice/httpd.service
├─2196 /usr/sbin/httpd -DFOREGROUND
├─2197 /usr/sbin/httpd -DFOREGROUND
└─2198 /usr/sbin/httpd -DFOREGROUND
Step 4 - Enable Apache
To enable Apache to start automatically at boot time, enter the following command:
sudo systemctl enable httpd
Step 5 - Firewall Configuration
By default, Fedora's firewall is enabled, which blocks incoming access to the web server. You can unblock the Apache HTTP service using the following command:
sudo firewall-cmd --add-service=http --permanent
This will allow incoming web traffic to the server.
Step 6 - Restart Apache
To apply the changes made, restart the Apache web server by running the following command:
sudo systemctl restart httpd
Conclusion
In this tutorial, we learned how to install Apache on Fedora Server Latest. You can now start building web applications or hosting a website using Apache. If you encounter any issues during the installation process, feel free to consult the official Apache documentation or seek help from the Fedora community.