一、安装Nginx源
执行以下命令:
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
二、安装Nginx
yum install -y nginx
三、常用命令
(1) 启动:
nginx
(2) 测试Nginx配置是否正确:
nginx -t
(3) 重启:
nginx -s reload
(4) 查看nginx的进程号:
ps -ef |grep nginx
(5)nginx服务停止
nginx -s stop
kill -9 pid