Apache is one of the most widely used web services in the world. When server resources are insufficient or less resource usage is desired, instead of using any server management panel (cPanel, Plesk, CWP, etc.), only the services to be used can be installed on the server to achieve high performance.
In this article, we will explain step by step how to install the Apache web service on the CentOS 7 operating system.
First of all, we recommend that you perform all updates of the CentOS operating system so that the system can work properly and security vulnerabilities can be closed. You need to have root privileges to perform the operations.
We update the yum packages before loading the service.
yum -y update
Note: The -y parameter indicates that yes will be answered to questions by default. If you do not write -y, when you are asked whether you want to continue, you can approve by typing y and pressing enter.
Then we install the Apache web service.
yum -y install httpdA message indicating that the service has been loaded will be displayed on the screen. We start the service and make the necessary setting for it to activate automatically when the server restarts.
systemctl start httpd
systemctl enable httpdThe web service is currently active. We allow ports 80 and 443 through the firewall.
firewall-cmd –permanent –add-port=80/tcp
firewall-cmd –permanent –add-port=443/tcpYou can stop the web service,
systemctl stop httpdRestart it,
systemctl restart httpdOr view its status.
systemctl status httpd
You can configure virtualhost settings from within the /etc/httpd/conf/httpd.conf file.
By default, the /var/www/html directory is set up for you to add your site files. You can upload your site files to this directory.
Service installation is complete. You can access your site via http://yourserveripaddress.
Leave a Comment
* Your comment will be published after approval.
Comments
0No comments yet. Be the first to comment!