How To Install Apache Web Server On Fedora 38

How To Install Apache Web Server On Fedora 38

In this short tutorial we will learn how to install Apache Web Server on Fedora 38 operating system.

Introduction

Fedora is a popular open-source Linux distribution that is often used for both desktop and server environments. You can use Fedora as the operating system for hosting and running an Apache web server. Here’s how we can set up an Apache web server on a Fedora system:

1. Update System
2. Install Apache Web server package
3. Start and enable Apache
4. Configure firewall
5. Verify Apache is running

Step 1: Update System

It’s a good practice to ensure your system is up to date before installing any new software. Open a terminal and run:

$ sudo dnf update

Step 2: Install Apache Web server package

Use the dnf package manager to install the Apache web server as shown below :

$ sudo dnf install httpd

After the successful installation, you can see detailed information about Apache with the following command.

$ rpm -qi httpd

Output :

[ramansah@fedora ~]$ rpm -qi httpd
Name : httpd
Version : 2.4.56
Release : 1.fc38
Architecture: x86_64
Install Date: Thu 13 Apr 2023 11:46:26 PM CEST
Group : Unspecified
Size : 61952
License : ASL 2.0
Signature : RSA/SHA256, Thu 09 Mar 2023 02:17:48 PM CET, Key ID 809a8d7ceb10b464
Source RPM : httpd-2.4.56-1.fc38.src.rpm
Build Date : Thu 09 Mar 2023 01:26:00 PM CET
Build Host : buildhw-x86-13.iad2.fedoraproject.org
Packager : Fedora Project
Vendor : Fedora Project
URL : https://httpd.apache.org/
Bug URL : https://bugz.fedoraproject.org/httpd
Summary : Apache HTTP Server
Description :
The Apache HTTP Server is a powerful, efficient, and extensible
web server.

Step 3 : Start and enable Apache

After the installation is complete, we can start Apache and enable it to start at boot using the following commands.

$ sudo systemctl start httpd
$ sudo systemctl enable http
Output :
[ramansah@fedora ~]$ sudo systemctl start httpd
[ramansah@fedora ~]$ sudo systemctl enable httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.

Step 4 :Configure firewall

If the Fedora firewall is active, we may need to open the HTTP port (80) to allow web traffic. Use the firewall-cmd command to do this:

$ sudo firewall-cmd --permanent --add-port=80/tcp
$ sudo firewall-cmd --permanent --add-port=443/tcp
$ sudo firewall-cmd --reload

Step 5: Verify Apache is running

We can check if Apache is running by accessing it in your web browser or using the following command:

$ sudo systemctl status httpd

Output :

[ramansah@fedora ~]$ sudo systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; preset: disabled)
Drop-In: /usr/lib/systemd/system/service.d
└─10-timeout-abort.conf
Active: active (running) since Sat 2023-11-04 03:56:01 CET; 9s ago
Docs: man:httpd.service(8)
Main PID: 2862 (httpd)
Status: "Total requests: 0; Idle/Busy workers 100/0;Requests/sec: 0; Bytes served/sec: 0 B/sec"
Tasks: 177 (limit: 4009)
Memory: 18.4M
CPU: 111ms
CGroup: /system.slice/httpd.service
├─2862 /usr/sbin/httpd -DFOREGROUND
├─2863 /usr/sbin/httpd -DFOREGROUND
├─2865 /usr/sbin/httpd -DFOREGROUND
├─2869 /usr/sbin/httpd -DFOREGROUND
└─2870 /usr/sbin/httpd -DFOREGROUND

Nov 04 03:56:01 fedora systemd[1]: Starting httpd.service - The Apache HTTP Server...
Nov 04 03:56:01 fedora httpd[2862]: AH00558: httpd: Could not reliably determine the server's fully qua>
Nov 04 03:56:01 fedora systemd[1]: Started httpd.service - The Apache HTTP Server.

If Apache is running, we should see an active status.

Apache web server on Fedora 38

 

Testing via web server

Open a web browser and enter your server’s IP address or domain name. You should see the default Apache test page if everything is set up correctly.

web server is running on Fedora

 

Conclusion

In this tutorial we have learned how to install Apache web server on Fedora 38 operating system successfully. I hope this short tutorial will be helpful for anyone whose searching for.

(Visited 65 times, 1 visits today)

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *