liunx local server can access the external network access but can not

Disclaimer: This article is CSDN blogger "tlytg456 'original article, follow the CC 4.0 by-sa copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/tlytg/article/details/76417099

 

Issues such as the title, problems of this sort, usually after we built Apache, local access to 127.0.0.1 or localhost, but it does not work when using the external network access server ip address.
In such cases, usually the host firewall in trouble, this time we have a variety of solutions.

Turn off the firewall

Use the following command to turn off the firewall

[the root @ localhost ~] # systemctl STOP firewalld.service
. 1
using the following command to turn off the firewall boot from the start

[root @ localhost ~] # systemctl disable firewalld.service
1
At this point you can view the status of the firewall

[the root @ localhost ~] # --state Firewall-cmd
. 1
if not running is displayed, close successful

Open the fixed port

Of course, the firewall is more important for us, so can we open the fixed port it?
Using the following command to open port 80 (similar to the other ports)

[root @ localhost] # firewall-cmd = --permanent --add-Port 80 / tcp
1
Note the need to declare tcp way, then we need to reload the firewall configuration

[the root @ localhost] # --reload Firewall-cmd
. 1
and you're done friends ~ ~
---------------------

Guess you like

Origin www.cnblogs.com/Chiler/p/11359596.html
Recommended