After compilation and installation, Ngnix, mysql, and PHP were found inaccessible. later, the firewall disabled port 80. Turn on: #/sbin/iptables-IINPUT-ptcp -- dport80-jACCEPT #/sbin/iptables-IINPUT-ptcp -- dport22-jACCEPT and save: #/etc/rc. d/I has worked hard to compile and install Ngnix, Mysql, PHP, and later found inaccessible, and later found that the firewall disabled port 80.
Check whether there are already:
[Root @ v Centos~] #/Etc/init. d/iptables status
Table: filter
Chain INPUT (policy ACCEPT)
Num target prot optsource destination
1 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt: 80
2 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt: 80
3 RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy ACCEPT)
Num target prot optsource destination
1 RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0
2. restart your computer.
1. the CentOS Operating system firewall has opened ports 80 and 22 by default.
2. you may not restart the computer either here:
#/Etc/init. d/iptables restart
Close the firewall and close its services:
3. View firewall information:
#/Etc/init. d/iptables status
4. disable the firewall service:
#/Etc/init. d/iptables stop
3. permanently disable the firewall
We can also disable the firewall permanently, but I do not recommend that you do this. you can disable the firewall permanently as follows:
# Chkconfig? Level 35 iptables off
You can also directly modify
/Etc/sysconfig/iptables
Add one
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport80-j ACCEPT
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service