推荐参考:http://www.ansen.org/centos-build-lnmp.html
网络配置:
1> vim /et/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0" BOOTPROTO="static" HWADDR="00:0C:29:8D:63:CD" NM_CONTROLLED="yes" ONBOOT="yes" TYPE="Ethernet" UUID="1c3691e3-a043-43fc-a145-68d6e2c4a50e" IPADDR=10.207.27.249 NETMASK=255.255.255.0 GATEWAY=10.207.27.1 DNS1=8.8.8.8 DNS2=4.4.4.4
2> 配置IP tables和端口
vim /etc/sysconfig/iptables
1 *filter 2 :INPUT ACCEPT [0:0] 3 :FORWARD ACCEPT [0:0] 4 :OUTPUT ACCEPT [0:0] 5 -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT 6 -A INPUT -p icmp -j ACCEPT 7 -A INPUT -i lo -j ACCEPT 8 -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT 9 -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT 10 -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT 11 -A INPUT -j REJECT --reject-with icmp-host-prohibited 12 -A FORWARD -j REJECT --reject-with icmp-host-prohibited 13 COMMIT
主要开放 22,3306和80三个端口
重启后生效: /etc/init
.d
/iptables
restart
3> 关闭SELINUX
vi
/etc/selinux/config
1 #SELINUX=enforcing #注释掉 2 #SELINUXTYPE=targeted #注释掉 3 SELINUX=disabled #增加 4 :wq 保存,关闭 5 shutdown -r now #重启系统