一、添加yum源
1 2 3 4 5 6 7 8 9 10 11 |
CentOS 7: rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm CentOS 6: rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm Cenos 5: rpm -ivh http://nginx.org/packages/centos/5/noarch/RPMS/nginx-release-centos-5-0.el5.ngx.noarch.rpm |
二、安装并启动nignx
1 2 3 |
yum install nignx service nginx start |
三、设置开机启动
1 |
systemctl enable nginx.service |