第一句:删除原来版本nginx
[rot@host1]# yum remove nginx
第二句:安装源中的nginx,可以选择版本 yum install nginx ==1.8x
[rot@host1]# yum install nginx
这就安装好了,可以进行nginx文件配置,在下的边路径上。
[rot@host1]# vi /etc/nginx/nginx.conf
启动和重启命令如下:
[rot@host1]# /usr/sbin/nginx -c /etc/nginx/nginx.conf #第一次启动 或者 启动报错时使用
[rot@host1]# /usr/local/nginx/sbin/nginx -s reload #重启
閱讀更多 IT資源先峰 的文章