Data Centers

How to install Apache on Fedora 26 through Cockpit

Installing Apache on Fedora Server 26 is made even easier with the help of Cockpit. Here's how to do it.

cockpithero.jpg
Image: Jack Wallen

If you've recently installed the Fedora 26 server, you may or may not know that there is an incredible tool (installed alongside the server), called Cockpit. This web-based tool makes it easy to administer your Fedora Server. Tasks you can manage are:

  1. Get a real-time glance at performance
  2. Restart the server
  3. View logs
  4. Check storage
  5. Manage networking
  6. Create/edit user accounts
  7. Manage services

One other feature Cockpit includes is access to a terminal. It is there that we are going to install Apache. That's right, Cockpit doesn't have a built-in software tool, so all installation is done through the command line. However, Cockpit does help you out with some of the steps.

With that said, let's see how this is done.

Accessing Cockpit

Once you have your server up and running, you gain access to Cockpit by pointing a browser to https://SERVER_IP:9090. Log in with the user root and the password you created during the operating system installation. Once within the Cockpit interface, click on the Terminal tab (Figure A).

Figure A

Figure A

The Cockpit dashboard.

As soon as you click the Terminal tab, you will find yourself in, not surprisingly, a terminal window for your server, logged in as the root user. You are ready to install.

Installing Apache

Before you install Apache, let's make sure the system is updated with the command:

dnf update

If there are any updates, run them. If necessary (should the kernel update), restart the server by going back to the System tab of Cockpit and clicking on the Restart button. If no restart is necessary, you can then install the Apache server with a single command:

dnf install httpd

You will be prompted to OK the installation (Figure B), so type y and the installation will begin.

Figure B

Figure B

Installing the necessary components for Apache.

After it finishes, head over to the Services tab, locate and click on the Apache entry. In the resulting window (Figure C), click the Start button to start the service and then click on the Enable button to enable Apache to start at boot.

Figure C

Figure C

Starting and enabling the Apache service.

Finally, you'll need to go back to terminal tab and issue the following commands to open up the firewall for the server:

firewall-cmd --add-service={http,https} --permanent
​firewall-cmd --add-port={80,443}/tcp --permanent
​sudo firewall-cmd --reload

When you've completed the above, point your browser to http://SERVER_IP and the Fedora Apache test page should appear.

Congratulations, you've installed Apache, on Fedora Server, with the help of Cockpit.

Wasn't that simple?

Also see

About Jack Wallen

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.

Editor's Picks

Free Newsletters, In your Inbox