Cnetos7 Yum安装Ningx
1.依赖项和必要组件
yum install -y make cmake gcc gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
2.获取rpm包
centos7默认是没有nginx源,nginx官网提供一个了RPM包,需要自行添加即刻使用yum安装nginx
rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
3.安装nginx
yum install -y nginx
nginx 常规操作
启动:
systemctl start nginx
重启
nginx -s reload
停止
nginx -s stop
退出
nginx -s quit
检查配置文件是否正确
nginx -t