The solution to the inaccessibility of the machine after installing Nginx on CentOS7 in the VMware virtual machine
After installing nginx on the virtual machine centos7, the virtual machine can be accessed, but the real machine cannot. Modifying the iptables configuration does not work. Finally, after searching the Internet for information, I found that the firewall of centos was changed to firewall, no longer called iptables, and open ports. The method is as follows:
firewall-cmd --zone=public --add-port=80/tcp --permanent
Command meaning:
--zone #scope
–add-port=80/tcp #Add port, the format is: port/communication protocol
–permanent #Permanent effect, invalid after restart without this parameter
Restart the firewall:
systemctl stop firewalld.service
systemctl start firewalld.service