CentOS快速安裝Nginx的方法,nginx如何啟動重啟停止


1、防止 make: command not found,提前安裝一些插件,取決於當前環境是否已安裝,如果已經安裝就不需要執行此命令

yum -y install gcc automake autoconf libtool make

防止 make: command not found

2、下載源碼進行安裝

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

3、安裝需要的插件

yum -y install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel

4、解壓壓縮包

tar -zxvf nginx-1.18.0.tar.gz

5、指定安裝路徑

./configure --prefix=/root/nginx/nginx-1.18.0

6、編譯並安裝

make && make install

7、啟動服務(進入到安裝目錄的sbin)

 ./nginx

8、重啟服務(進入到安裝目錄的sbin)

./nginx -s reload         

9、停止服務(進入到安裝目錄的sbin)

./nginx -s stop  或者 ./nginx -s quit


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM