In the virtual machine Linux installed httpd, that is, Appache, after booting, according to normal situation in the host can be accessed by the browser by accessing the virtual machine Linux IP. In the event of an unreachable situation, the workaround can be as follows:
Here my virtual machine is connected to a physical connection, and the IP is different from the host, but in the same network segment.
1, first determine whether the virtual machine can access the external network, ping www.baidu.com test, if not, first Baidu or reference other information or Setup to configure IP-related information (of course, if you host network)
2, the host and the virtual machine through their respective IP ping, if the host can ping the virtual machine, and the virtual machine can not ping the host, consider whether the host computer firewall is not off, many cases is this reason, the firewall can be resolved.
3, if the above are not a problem, or can not be resolved, it may be iptable restrictions. Configure TCP port 80 with the following command to allow any IP access.
Command:
-j ACCEPT
Note that the Linux commands are case-sensitive
However, the method of the third step is only temporary, as long as you restart the virtual machine or restart the Linux, it must be reset to access, the solution is as follows:
At the command line, enter:
Vi/etc/selinux/config
will open the VI editor
To modify a file:
Will be SELINUX=enforcing
This line is commented out, and a line is added as follows:
#SELINUX =Enforcingselinux=disabled
Save again, and then continue to enter the command:
3 5 iptables off
Then restart Linux, take effect, it's ready.
At this point the host can access the virtual machine to open Apache (here is just the Apache example, it should be said that the host browser can access the virtual machine IP)
Host cannot access virtual machine for Linux Apache