How to install Apache on Fedora server

Installing Apache on Fedora Server can be frustrating if you don't know the right commands to run. Jack Wallen helps ease your suffering.

How to install Apache on Fedora server

So you've decided to give the Fedora Server a try, and the first thing you want to do is install Apache. This makes perfect sense, as Fedora Server is an outstanding platform, and Apache is one of the most popular web servers on the planet.

But how do you make this happen? It's actually quite easy when you know the right commands. Let's get this up and running to see how it's done.

SEE: Server deployment/migration checklist (Tech Pro Research)


The first step is to install the web server itself. We'll just install the basic Apache package. This is done with the command sudo dnf install httpd. If you want to install the full web server group (which includes a large number of extra packages), that command would be sudo dnf group install "Web Server."

Now that Apache is installed, you can reach the server by starting and enabling the server with the commands sudo systemctl start httpd and sudo systemctl enable httpd, and then pointing a web browser to the server IP address. Correct? No. Why? At the moment, the firewall is blocking incoming requests to most every port. Because of this, we have to open the port with the firewall-cmd command. To open both http and secure http, the command would be sudo firewall-cmd --add-service=http --add-service=https --permanent.

If the rule has already been added, you'll see an error. That command will add the rule but doesn't reload the firewall. To reload the firewall, issue the command sudo firewall-cmd --reload. Now you should be able to point a web browser to http://SERVER_IP (where SERVER_IP is the IP address of the server) and see the Apache welcome screen.

And that, my friends, is all there is to installing the Apache web server on the Fedora Server platform.

Also see

Image: Fedora