首頁  >  文章  >  運維  >  Nginx安裝實例分析

Nginx安裝實例分析

WBOY
WBOY轉載
2023-05-15 10:52:061070瀏覽

1. 安裝gcc(centos 7之後一般已自帶,可以在第6步失敗後再安裝)

yum install gcc gcc-c

#2. 安裝pcre

yum install -y pcre pcre-devel

3. 安裝zlib

#yum install -y zlib zlib-devel

4. 安裝openssl

yum install -y openssl openssl-devel

#5. 下載並解壓縮nginx(之後進入nginx目錄)

#wget

6. 編譯nginx(載入常用模組如ssl)

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_gzip_static_module --with-http_ssl_module

##7 . 安裝nginx

make && make install


8. 啟動

/usr/local/nginx/sbin/nginx


9. 停止

/usr/local/nginx/sbin/nginx -s stop(reload表示重新啟動)


#10. 瀏覽器存取nginx所在機器ip,驗證nginx啟動成功

#http://yourhost/


附註:nginx設定檔位置

/usr/local/nginx/conf/nginx.conf

#

以上是Nginx安裝實例分析的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:yisu.com。如有侵權,請聯絡admin@php.cn刪除