A server that can be written in python can be found to be normal during testing on Ubuntu14.04.3. However, after setting up the environment on CentOS6.3, it is found that the http requests to specific ports, such as 8000, cannot be accessed, it's hard to explain. At last, we found that the firewall blocked access to special ports. The development port on the current host is as follows: using iptables to open the following ports/sbin/iptables-I can be written in python on servers tested on Ubuntu 14.04.3, it is normal, but after setting up the environment on CentOS 6.3, it is found that for specific ports, for example, 8000 of http requests cannot be accessed. At last, we found that the firewall blocked access to special ports.
The development port on the current host is as follows:
The following describes how to open a specific Port:
Use iptables to open the following ports:
/Sbin/iptables-I INPUT-p tcp -- dport 8000-j ACCEPT
/Sbin/iptables-I INPUT-p tcp -- dport 8090-j ACCEPT
/Sbin/iptables-I INPUT-p tcp -- dport 10000-j ACCEPT
/Sbin/iptables-I INPUT-p tcp -- dport 12000-j ACCEPT
Save
/Etc/rc. d/init. d/iptables save
Restart service
Service iptables restart
Check whether the port to be opened takes effect?
/Etc/init. d/iptables status
It can be seen that our requirements are met.