На только что установленном Fedora Server (Fedora release 21) столкнулся с тем, что httpd снаружи не доступен на 80-м порту. Чтобы открыть внутри помогло /sbin/iptables -A INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT
.
А снаружи firewall-cmd --add-service=http
Хотя
1 2 3 4 5 6 |
[root@localhost logs]# netstat -ntulp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp6 0 0 :::80 :::* LISTEN 2882/httpd 983/dhclient |
А теперь о том, как надо было поступить правильно. Нужно читать документацию. Там как раз об этом написано:
1 2 3 |
Red Hat Enterprise Linux does not allow HTTP and HTTPS traffic by default. To enable the system to act as a web server, make use of firewalld's supported services to enable HTTP and HTTPS traffic to pass through the firewall as required. To enable HTTP using the command line, issue the following command as root: firewall-cmd --add-service http |
Или навсегда:
1 |
firewall-cmd --permanent --add-service http |
И перезапустить файервол:
1 |
sudo systemctl restart firewalld |
Удачная статья о настройке файервола — How To Set Up a Firewall Using FirewallD on CentOS 7