环境:
关闭 iptales和selinux 这个只为好测试
systemctl disable firewalld.service #禁止firewall开机启动
安装的东西:
yum -y install gcc gcc-c++ autoconf pcre pcre-devel make automakeyum -y install wget httpd-tools vim
确认工作:
用 ping 查看是否能链接网络yum list|grep gcc 查看yum能否使用iptables -L查看规则iptables -F关闭规则iptables -t nat -Liptalbes -t nat -F查看selinux
修改 /etc/selinux/config SELINUX=disabled
getenforce
setenforce 0
nginx的安装方式
http://nginx.org/en/linux_packages.html#RHEL-CentOS
sudo yum install yum-utils
创建文件
/etc/yum.repos.d/nginx.repo
[nginx-stable]name=nginx stable repobaseurl=http://nginx.org/packages/centos/$releasever/$basearch/gpgcheck=1enabled=1gpgkey=https://nginx.org/keys/nginx_signing.key[nginx-mainline]name=nginx mainline repobaseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/gpgcheck=1enabled=0gpgkey=https://nginx.org/keys/nginx_signing.key
sudo yum install nginx
启用nginx
systemctl start nginx.service
开机启动
systemctl enable nginx.service