In the virtual machine Linux installed httpd, that is, Appache, after the boot, according to the normal situation in the host can be accessed by the browser through the virtual machine Linux IP to access. If an inaccessible situation occurs, the solution can refer to the following:
Here my virtual machine networking mode for the physical connection, and the IP is different from the host, but on the same network segment.
1, first determine whether the virtual machine can access the extranet, through ping www.baidu.com test, if not, first Baidu or reference other information or setup their own IP-related information (of course, the prerequisite is your 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 host, consider whether the host computer firewall is not off, many cases is this reason, the firewall can be closed to solve.
3, if the above is no problem, or can not be resolved, it may be iptable restrictions. Configure TCP's 80 port to allow any IP access by using the following command
Command:
Iptables-i input-p TCP--dport 80-j ACCEPT
Note that Linux commands are case-sensitive
However, the third step above is only a temporary effect, as long as you restart the virtual machine or restart Linux, you must 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 selinux=enforcing
This line is commented out, and one line is added, as follows:
#SELINUX =enforcing
selinux=disabled
Save again, and then continue to enter the command:
Root@fedora6 ~]# chkconfig--level 3 iptables off
[Root@fedora6 ~]# chkconfig--level 5 iptables off
Then restart Linux, and it will take effect.
Then 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)