Apache is one of the most used web services in the world. When hardware is insufficient or fewer resources are required on the server, instead of using any server management panel (
cPanel, Plesk, CWP, etc.), only the services to be used can be installed on the server and high performance can be obtained from the server.
In this article, we will explain step by step how to install Apache web service to
Centos 7 operating system.
First of all, we advise you to make all the updates of the
Centos operating system in order to keep the system running properly and to close the security gaps. You must have
root the privilege to perform operations.
We need to update
yum packages before installing the service.
yum -y update
Note: The -y parameter specifies that by default, yes answers to questions. If you do not type -y, you can confirm by typing y and pressing enter when you are prompted to continue.
Then we install
Apache web service.
yum -y install httpd
The message indicating that the service is installed will be displayed on the screen. We start the service and make the necessary settings to be activated automatically when the server restarts.
systemctl start httpd
systemctl enable httpd
The web service is currently active. We allow http (80) and https (443) ports over the firewall.
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=443/tcp
You can stop the web service,
systemctl stop httpd
You can restart,
systemctl restart httpd
You can view the status.
systemctl status httpd
You can configure
By default, the
/ var / www / html directory is set so that you can add site files. You can upload your site files into this directory.
Service installation is now complete. You can access your site via the http: // ipaddressofyourserver.
I hope it has been a useful article.