Installed nginx+mysql+php in the virtual machine, the desktop in the virtual machine can be accessed,
- netstat -ntlp | grep 80
- lsof -i:80
There is also corresponding port information.
But outside the virtual machine can not be accessed through ip access.
- iptables -L -n
Check the firewall settings and find that port 80 is not open.
Solution:
First, close the firewall
- service iptables stop
Not recommended
Second, open this port on the firewall.
- vim /etc/sysconfig/iptables
- -A INPUT -m state --state NEW -m tcp -p tcp --dport 80-j ACCEPT
restart iptables
- service iptables restart
Another: open a range of ports 22 to 80
- -A INPUT -m state --state NEW -m tcp -p tcp --dport 22:80-j ACCEPT
More please support: http://www.webyang.net/Html/web/article_173.html