Step 1: Yum install httpd – y # install httpd service
Step 2: systemctl start httpd
Step 3: systemctl enable httpd # set httpd service to boot
Step 4: firewall CMD — zone = public — add port = 80 / TCP — permanent ᦇ open port 80 of the firewall and make it permanent, and return the meaning of success setting. (- permanent is permanent and will be invalid after restart without this parameter)
Step 5: systemctl restart firewalld.service Restart the firewall to make the settings take effect
Step 6: firewall CMD — zone = public — Query port = 80 / TCP # check whether port 80 is open, return yes, open successfully, return no, not open (no will be returned if the firewall is not restarted after setting)
Step 7: copy the source file of the website to the / var / www / HTML directory, or delete the / var / www / HTML directory, and then copy the source file directory to the / var / www directory, and change the name to the HTML directory index.html Default home page file.
Step 8: the browser enters the local IP address to test the domain name. You need to apply for the domain name first, then do the domain name resolution, and use it after binding the public IP.