43.4 F
Nashville
Thursday, November 21, 2024

How to Install the Apache Web Server on CentOS 9

Apache is available within CentOS's default software repositories, which means you can install it with yum.

How to Create Users in Linux

Linux is a multi-user system, meaning that more than one person can interact with the same system simultaneously.

How to Create Bash Aliases

This tutorial demonstrates how to use the alias command to create personalized shortcuts, which can help you save time and feel less frustrated.

How to Install the Apache Web Server on CentOS 9

First, update your systems package index

dnf update -y

Install Apache

dnf install httpd -y

Once the installation is complete, enable and start the Apache service

systemctl enable httpd

systemctl start httpd

Configure the Firewall to allow http and https traffic

firewall-cmd –permanent –add-service=http

firewall-cmd –permanent –add-service=https

firewall-cmd –reload

Verify Apache Installation

systemctl status httpd

Configure Apache (Optional)

Apache’s configuration files are located in the following directory

/etc/httpd

Run the following command to see the location of the main configuration file

find ‘/etc/httpd’ -name “httpd.conf”

The main configuration file is httpd.conf and should be located in the /etc/httpd/conf folder

Apache error logs

If you encounter any issues, check your Apache error logs located in /var/log/httpd/error_log

When it comes to restarting the Apache server, there are several reasons why you might need to do so. Some of the most common reasons are performance issues, configuration changes, and security updates.

systemctl restart httpd

To stop your web server, type:

systemctl stop httpd

Learn about the popular Apache HTTP Web Server on the official site https://httpd.apache.org/

Similar Articles

- A word from our sponsors -

Follow Us

Most Popular