The local machine fails to access the web server of the virtual machine. a lamp is set up in the virtual machine at noon, and the browser of the host machine is used to access the web server of the virtual machine, but the access fails, again, I checked the local machine and Virtual Machine and found that the situation was like this:
1. host Machine can ping the Virtual Machine 2. the virtual machine can ping the host machine. 3. virtual machines can access web servers through http: // localhost. 4. the host machine cannot access the web server through a browser
First, I telnet the VM's window 80 in the dos window of the host machine, but failed. It can be determined that there is a problem with the VM's window 80, which should be blocked by the firewall. Www.2cto.com has been searching for a long time and finally found a solution:
1. modify firewall settings: Enter the command/sbin/iptables-I INPUT-p tcp -- dport 80-j accept2in Shell to save the above settings:/etc/rc. d/init. d/iptables saved3. restart the firewall:/etc/init. d/iptables restart: Enter the IP address of the VM in the local browser. The web server is successfully accessed !! The following are the results of accessing the index. php file.
Prepared by AI_Net