Nginx Linux詳細安裝部署教程

2021-10-14 14:20:43 字數 1887 閱讀 6634

nginx (「engine x」) 是乙個高效能的 http和反向**伺服器,也是乙個imap/pop3/smtp 伺服器。

正向**:

反向**:

1、http伺服器,可以做靜態網頁的http伺服器。

2、配置虛擬機器。乙個網域名稱可以被多個ip繫結。可以根據網域名稱的不同吧請求**給執行在不同埠的伺服器。

3、反向**,負載均衡。把請求**給不同的伺服器。

官方**:

環境配置:

pcre

pcre(perl compatible regular expressions)是乙個perl庫,包括 perl 相容的正規表示式庫。nginx的http模組使用pcre來解析正規表示式,所以需要在linux上安裝pcre庫。

yum install -y pcre pcre-devel

注:pcre-devel是使用pcre開發的乙個二次開發庫。nginx也需要此庫。

zlib

zlib庫提供了很多種壓縮和解壓縮的方式,nginx使用zlib對http包的內容進行gzip,所以需要在linux上安裝zlib庫。

yum install -y zlib zlib-devel

openssl

openssl 是乙個強大的安全套接字層密碼庫,囊括主要的密碼演算法、常用的金鑰和證書封裝管理功能及ssl協議,並提供豐富的應用程式供測試或其它目的使用。

nginx不僅支援http協議,還支援https(即在ssl協議上傳輸http),所以需要在linux安裝openssl庫。

yum install -y openssl openssl-devel

編譯及安裝:

第一步:把nginx的原始碼包上傳至linux伺服器

第二步:解壓原始碼包。 tar -zxf nginx-1.8.0.tar.gz -c /url/local/

第三步:進入nginx-1.8.0資料夾。使用configure命令建立makefile。 .

/configure

第四步:make

第五步:make install

啟動

cd /usr/local/nginx/sbin

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

關閉nginx

查詢nginx主程序號

ps-ef | grep nginx

從容停止 kill

-quit 主程序號

快速停止 kill

-term 主程序號

強制停止 kill

-9 nginx

動態載入配置檔案

cd /usr/local/nginx/sbin

./nginx -s reload

不關閉nginx的情況下更新配置檔案。

Nginx Linux詳細安裝部署教程

nginx是乙個web伺服器也可以用來做負載均衡及反向 使用,目前使用最多的就是負載均衡,下面介紹安裝步驟 root localhost src wget root localhost src wget root localhost src wget root localhost src wget ...

Nginx Linux安裝詳解

nginx是乙個web伺服器,可以用於負載均衡和反向 的乙個工具 安裝c 編譯環境 root localhost src yum install gcc c 第二步 解壓安裝對應的軟體 一 openssl安裝 解壓 root localhost tar zxvf openssl fips 2.0.1...

nginx linux 安裝 啟動 公升級

nginx linux 安裝 啟動 公升級 2 解壓,執行configure指令碼 tar zxvf nginx 1.10.3.tar.gz cd nginx 1.10.3 configure make sudo make install3 若執行config報錯,很有可能是環境依賴的問題,執行如下...