第一句:刪除原來版本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資源先峰 的文章