日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

nginx在linux下安装,Nginx在linux下安装及简单命令

發布時間:2023/11/27 生活经验 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 nginx在linux下安装,Nginx在linux下安装及简单命令 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

安裝環境:Centos7

創建目錄及切換至目錄

# mkdir /usr/local/nginx

# cd /usr/local/nginx/

wget http://nginx.org/download/nginx-1.17.3.tar.gz

解壓nginx包及移至解壓目錄

# tar -zxvf nginx-1.17.3.tar.gz

# cd nginx-1.17.3/

設置安裝路徑

# ./configure --prefix=/usr/local/nginx

若出現錯誤【checking for C compiler ... not found】需要執行如下命令

# yum -y install gcc gcc-c++ autoconf automake make

若出現下面的錯誤,需要安裝openssl

./configure: error: the HTTP rewrite module requires the PCRE library.

You can either disable the module byusing --without-http_rewrite_module

option, or install the PCRE library into the system, or build the PCRE library

staticallyfrom the source with nginx by using --with-pcre= option.

安裝openssl命令

# yum -y install openssl openssl-devel

編譯--make是用來編譯的,它從Makefile中讀取指令,然后編譯。

# make

安裝--make install是用來安裝的,它也從Makefile中讀取指令,安裝到指定的位置。

# make install

至此,nginx已經安裝成功,接下來可以執行nginx命令來操作nginx

命令

啟動 --?# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

重啟 -- #?nginx -s reload

重新打開日志文件 -- #?nginx -s reopen

測試nginx配置文件是否正確 -- #?nginx -t -c /usr/local/nginx/conf/nginx.conf

快速停止 -- # nginx -s stop

完整有序的停止 -- # nginx -s quit

也可以通過進程停止nginx

查詢nginx主進程號 -- #?ps -ef | grep nginx

有序停止 -- #?kill -QUIT 主進程號

快速停止 -- #?kill -TERM 主進程號

強制停止 -- #?pkill -9 nginx

平滑啟動 -- #?kill -HUP 主進程號

總結

以上是生活随笔為你收集整理的nginx在linux下安装,Nginx在linux下安装及简单命令的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。