Linux serverNETWORK ADMINISTRATIONS

How To Install the Apache Web Server on CentOS 8

#Apache #WebServer on #CentOS8

Prerequisites
You will need the following to complete this guide:
A non-root user with sudo privileges configured on your server, set up by following the initial server setup guide for CentOS 8.
Ensure that a basic firewall is configured by following Step 4 of the Initial Server Setup with CentOS 8 (recommended) in the above guide.

Step 1 — Installing Apache
Apache is available within CentOS’s default software repositories, which means you can install it with the dnf package manager.

As the non-root sudo user configured in the prerequisites, install the Apache package:
sudo dnf install httpd

Next, reload the firewall to put these new rules into effect:
sudo firewall-cmd –reload

Configure Apache to permanent http service firewall,
sudo firewall-cmd –permanent –add-service=http

Step 2 — Checking your Web Server
Apache does not automatically start on CentOS once the installation completes, so you will need to start the Apache process manually:
sudo systemctl start httpd

To re-enable the service to start up at boot, type:
sudo systemctl enable httpd
Verify that the service is running with the following command:
sudo systemctl status httpd

reload the firewall
sudo firewall-cmd –reload

Check host IP
hostname -I

Step 3 — Managing the Apache Process

To stop your web server, type:
sudo systemctl stop httpd
To start the web server when it is stopped, type:
sudo systemctl start httpd
To stop and then start the service again, type:
sudo systemctl restart httpd
If you are simply making configuration changes, Apache can often reload without dropping connections. To do this, use this command:
sudo systemctl reload httpd
By default, Apache is configured to start automatically when the server boots. If this is not what you want, disable this behavior by typing:
sudo systemctl disable httpd

Setup, configure, manage, support Windows and Linux Servers, Administrator, Continued development and maintenance of automated scripts for both environment configuration also Research and troubleshoot environment issues to determine root cause, maintain systems and procedures in accordance with PCI compliance, perform rotational on-call duties, interact with clients as needed.

source

centos 8

Leave a Reply

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