: This article mainly introduces tomcat and nginx for accessing linux virtual machines on Windows 7 host machines. if you are interested in PHP tutorials, refer to them. First, it is emphasized that the host and the virtual machine set up by VMware communicate in NAT mode.
Briefly describe the steps for successful service access:
1. make sure that the tomcat or nginx service is enabled on your VM;
2. Add the port forwarding configuration in the virtual machine. in the vmware menu bar, edit the configuration> Virtual Network editor:
Click "Add..."
Add the port on which you want to forward data to the VM through the host,
Click OK.
If you cannot access the port you forwarded locally, analyze the cause:
For example, the port you forward is 8000.
1. telnet localhost 8000 on the win7 host. if you can connect to it, it means there is no problem on the win7 host;
2. disable the firewall of your virtual machine in two ways:
I) service iptables stop)
II) chkconfig iptables off (feature: the server needs to be restarted and takes effect permanently)
If neither of the preceding methods is available, set selinux to disabled:
First, check the selinux status command:
/Usr/sbin/sestatus-v,
If it is enabled, change the vi/etc/selinux/config file to disable it:
In the config file, find SELINUX = enforcing and change it to SELINUX = disabled.
Restart the machine. OK.
I spent two nights doing well. it turned out to be the cause of selinux. after being set to disabled, the access was successful. haha, thank you for your help!
The above introduces tomcat and nginx for accessing linux virtual machines on the Windows 7 host machine, including some content, and hope to help those who are interested in PHP tutorials.