xmxm76 发表于 2018-11-18 07:31:09

CentOS 7.0安装配置LAMP服务器(Apache + PHP + MariaDB)

# yum install iptables-services# vim /etc/sysconfig/iptables  
            # sample configuration for iptables service
  
            # you can edit this manually or use system-config-firewall
  
            # please do not ask us to add additional ports/services to this default configuration
  
            *filter
  
            :INPUT ACCEPT
  
            :FORWARD ACCEPT
  
            :OUTPUT ACCEPT
  
            -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
  
            -A INPUT -p icmp -j ACCEPT
  
            -A INPUT -i lo -j ACCEPT
  
            -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
  
            -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
  
            -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
  
            -A INPUT -j REJECT --reject-with icmp-host-prohibited
  
            -A FORWARD -j REJECT --reject-with icmp-host-prohibited
  
            COMMIT
  
# systemctl restart iptables.service      #最后重启防火墙使配置生效# systemctl enable iptables.service      #设置防火墙开机启动


页: [1]
查看完整版本: CentOS 7.0安装配置LAMP服务器(Apache + PHP + MariaDB)