一、NGINX 下載
mkdir -p /soft/nginx
cd /soft/nginx
wget https://nginx.org/download/nginx-1.21.6.tar.gz
二、下載相關(guān)依賴
①在線安裝依賴:
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
②下載依賴到本地安裝依賴:
yum install --downloadonly --downloaddir=/soft/nginx/ gcc-c++
yum install --downloadonly --downloaddir=/soft/nginx/ pcre pcre-devel4
yum install --downloadonly --downloaddir=/soft/nginx/ zlib zlib-devel
yum install --downloadonly --downloaddir=/soft/nginx/ openssl openssl-devel
cd /soft/nginx
rpm -ivh --nodeps *.rpm
建議內(nèi)網(wǎng)先下載安裝包和依賴通過介質(zhì)拷貝至系統(tǒng);
三、NGINX 安裝編譯
cd /soft/nginx
tar -zxvf nginx-1.21.6.tar.gz
cd nginx-1.21.6
./configure
make
make install
注:編譯后會在安裝目錄的同層(/soft/nginx/)生成nginx應(yīng)用目錄,相關(guān)配置、啟動在此層。而不是在安裝目錄下一層(/soft/nginx/nginx-1.21.6/)或者使用whereis nginx查看軟件目錄,如果查詢沒有反應(yīng),以前者為準(zhǔn)。
三、NGINX 啟動和其他相關(guān)命令
啟動nginx:
cd /soft/nginx/sbin/
./nginx
檢查nginx是否啟動:
ps aux | grep nginx
檢測nginx配置文件是否正常 :
./nginx -t -c conf/nginx.conf
修改配置后平滑重啟:
./nginx -s reload -c conf/nginx.conf
執(zhí)行完當(dāng)前的任務(wù)后再退出:文章來源:http://www.zghlxwxcb.cn/news/detail-556288.html
./nginx -s quit
強(qiáng)制終止Nginx:文章來源地址http://www.zghlxwxcb.cn/news/detail-556288.html
./nginx -s stop
到了這里,關(guān)于[NGINX] NGINX下載、安裝編譯、啟動檢查停止命令的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!