After installing Nginx in Linux under the virtual machine, how to deal with the problem that the host cannot be accessed

WBOY
Release: 2016-07-29 09:12:40
Original
2205 people have browsed it

After installing the Nginx server under Linux in the virtual machine, the machine can obtain the web content through curl, but it cannot be accessed on the host machine and the following error occurs:

After installing Nginx in Linux under the virtual machine, how to deal with the problem that the host cannot be accessed

In this case, it is usually Linux The system's firewall rules need to be configured to open the network ports you need to access. The settings are as follows:

After installing Nginx in Linux under the virtual machine, how to deal with the problem that the host cannot be accessedOpen the file /etc/sysconfig/iptables for editing, and add 12 lines under the default port 22 of ssh for nginx For the server, 13 more lines of port 3306 are added here for remote access to mysql. After configuration, just restart the firewall.

service iptables restart

Try again on the host:

After installing Nginx in Linux under the virtual machine, how to deal with the problem that the host cannot be accessed

ConfigurationSuccessful!

The above introduces how to handle the situation when the host cannot be accessed after installing Nginx in Linux under the virtual machine, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template