Reading Time: < 1 minute
Apache is the world’s most popular web server, due in part to its power, ease of administration, and flexibility. In this tutorial we will install Apache on a server that doesn’t have a web server or database server already installed.
- These instructions are intended for installing Apache on a single Fedora 23 node.
- We’ll be working from a Liquid Web Self Managed Fedora 23 server, and we’ll be logging in as non-root user. If you need more information, then visit our tutorial How to Add a User and Grant Root Privileges on Fedora 23.
Step #1: Install Apache
First, we’ll clean up our package data:
sudo dnf clean all
That should produce output similar to the following:
[root@host ~]# sudo dnf clean all
Cleaning repos: fedora stable-arch updates stable-noarch stable-generic
Cleaning up Everything
As a matter of best practice we’ll now update our packages as well:
sudo dnf -y update
Installing Apache is as simple as running just one command:
sudo dnf -y install httpd
Step #2: Allow Apache Through the Firewall
Allow the default HTTP and HTTPS port, ports 80 and 443, through firewalld:
sudo firewall-cmd --permanent --add-port=80/tcp
sudo firewall-cmd --permanent --add-port=443/tcp
Now reload the firewall for the new settings to take effect:
sudo firewall-cmd --reload
You should see a “”success” message after each of those commands.
Step #3: Configure Apache to Start on Boot
First, start Apache:
sudo systemctl start httpd
Set Apache to start at boot:
sudo systemctl enable httpd
That command should produce output similar to the following:
[root@host ~]# sudo systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
To check the status of Apache:
sudo systemctl status httpd
To stop Apache:
sudo systemctl stop httpd