The first step: yum install httpd -y #install httpd service
Step 2: systemctl start httpd #Start httpd service
The third step: systemctl enable httpd #Set httpd service to boot
The fourth step: firewall-cmd –zone=public –add-port=80/tcp –permanent #Open port 80 of the firewall and take effect permanently, and return to the meaning of success. (-Permanent means permanent effect, it will be invalid after restart without this parameter)
Step 5: systemctl restart firewalld.service #Restart the firewall to make the settings effective
The sixth step: firewall-cmd –zone=public –query-port=80/tcp #Check whether port 80 is open, return yes to open successfully, return no is not open (no after the setting is completed, the firewall will return no)
Step 7: Copy the source files of the website to the /var/www/html directory# or delete the /var/www/html directory, then copy the source file directory to the /var/www directory and rename the html directory, html directory There must be index.html default homepage file in it.
The eighth step: the browser enters the local IP address test # domain name, you need to apply for the domain name first, and then do [domain name resolution] (https://cloud.tencent.com/product/cns?from=10680), bind the public IP and use it.
to sum up
So far this article about centos8 using Apache httpd2.4.37 to install a web server is introduced. For more related centos8 using Apache httpd2.4.37 to install a web server, please search for previous articles by ZaLou.Cn or continue to browse the following related articles I hope you will support ZaLou.Cn a lot in the future!
Recommended Posts