<form id="dlljd"></form>
        <address id="dlljd"><address id="dlljd"><listing id="dlljd"></listing></address></address>

        <em id="dlljd"><form id="dlljd"></form></em>

          <address id="dlljd"></address>
            <noframes id="dlljd">

              聯系我們 - 廣告服務 - 聯系電話:
              您的當前位置: > 關注 > > 正文

              天天觀點:yydsNginx–無root權限安裝(內網安裝)

              來源:CSDN 時間:2023-04-03 10:56:34

              前言:

              同步文章圖片有問題想看帶有圖片版的請移步: https://www.yuque.com/docs/share/3fbd7d5a-639c-4ca8-8500-00071b7cb23d?#BvpWF本篇文章涉及nginx的安裝,目前分為兩個版本linux安裝和win10的安裝 其中nginx的安裝涉及到無root權限和在內網的情況下如何安裝,對應的安裝資源如下: 鏈接:https://pan.baidu.com/s/1EKGHX2oKIMdD8n7ravVwyQ 提取碼:yyds win10版本的nginx安裝包如下: 鏈接:https://pan.baidu.com/s/1n-6m0UhKhTtSprpzwm9HFA 提取碼:yyds

              Nginx–linux安裝


              (相關資料圖)

              無root權限安裝(內網安裝)

              1、創建tool目錄

              ![image.png](https://img-blog.csdnimg.cn/img_convert/003749d4e63e0de4393d34f08eaad45d.png#clientId=u7adaedac-c8f4-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=161&id=u03392ca2&margin=[object Object]&name=image.png&originHeight=161&originWidth=387&originalType=binary&ratio=1&rotation=0&showTitle=false&size=7037&status=done&style=none&taskId=u6ce7ee55-ab3c-43b3-afda-f6ff75e4de6&title=&width=387)

              2、將nginx安裝所需要的依賴放在tool目錄下(這里我使用的是ftp工具)

              ![image.png](https://img-blog.csdnimg.cn/img_convert/469bc879a8382374e74b6e3ccbde5abd.png#clientId=u7adaedac-c8f4-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=547&id=ua803cc0a&margin=[object Object]&name=image.png&originHeight=547&originWidth=823&originalType=binary&ratio=1&rotation=0&showTitle=false&size=75116&status=done&style=none&taskId=u94899d44-05e1-4c90-b095-3cfca0d1e49&title=&width=823)

              3、將文件依次解壓到當前目錄

              ![image.png](https://img-blog.csdnimg.cn/img_convert/0110b4bb298132200a41e9432b44e5f0.png#clientId=u7adaedac-c8f4-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=182&id=u413672fc&margin=[object Object]&name=image.png&originHeight=182&originWidth=838&originalType=binary&ratio=1&rotation=0&showTitle=false&size=26339&status=done&style=none&taskId=u47c06192-2cdf-4c5f-9bfd-3a1ad70dcf8&title=&width=838)

              4、進入nginx-1.18.0目錄下執行依次以下命令

              注:第一條命令解析:./configure --prefix=/app/ywgk/nginx --with-http_realip_module --with-http_sub_module --with-http_flv_module --with-http_dav_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_addition_module --with-pcre=/app/ywgk/tool/pcre-8.44 --with-openssl=/app/ywgk/tool/openssl-1.1.1g --with-http_ssl_module --with-zlib=/app/ywgk/tool/zlib-1.2.11 第一處:/app/ywgk/nginx 為nginx安裝的絕對路徑 第二處:/app/ywgk/tool/pcre-8.44 為上一步解壓縮nginx的依賴pcre的絕對路徑 第三處:/app/ywgk/tool/openssl-1.1.1g 為上一步解壓縮nginx的依賴openssl的絕對路徑 第四處:/app/ywgk/tool/zlib-1.2.11為上一步解壓縮nginx的依賴zlib的絕對路徑

              第一條:注(/app/ywgk/tool 此處填寫絕對路徑)./configure --prefix=/app/ywgk/nginx --with-http_realip_module --with-http_sub_module --with-http_flv_module --with-http_dav_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_addition_module --with-pcre=/app/ywgk/tool/pcre-8.44 --with-openssl=/app/ywgk/tool/openssl-1.1.1g --with-http_ssl_module --with-zlib=/app/ywgk/tool/zlib-1.2.11第二條:make第三條:make install

              ![image.png](https://img-blog.csdnimg.cn/img_convert/ceca94db81e3af26d63488089527c259.png#clientId=u7adaedac-c8f4-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=708&id=u377803f0&margin=[object Object]&name=image.png&originHeight=708&originWidth=764&originalType=binary&ratio=1&rotation=0&showTitle=false&size=95973&status=done&style=none&taskId=u38cdb866-50b9-4620-9f71-dfdaea9f94c&title=&width=764)

              5、去到/app/ywgk/nginx下可以看到nginx安裝完成

              ![image.png](https://img-blog.csdnimg.cn/img_convert/c1b2b3fe193ac2495ce34e2a6cc642f0.png#clientId=u7adaedac-c8f4-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=108&id=u06dd3838&margin=[object Object]&name=image.png&originHeight=108&originWidth=280&originalType=binary&ratio=1&rotation=0&showTitle=false&size=3417&status=done&style=none&taskId=u43da241b-5bdf-4039-a539-679e671cb77&title=&width=280) 訪問對應ip加端口可以看到nginx的首頁 ![image.png](https://img-blog.csdnimg.cn/img_convert/b7180fb78bd6fcfdef171a89ff4d8715.png#clientId=u7adaedac-c8f4-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=256&id=u35a67497&margin=[object Object]&name=image.png&originHeight=440&originWidth=960&originalType=binary&ratio=1&rotation=0&showTitle=false&size=19213&status=done&style=none&taskId=u845cffa5-8a82-4a4c-b24c-ffc06458cb8&title=&width=558)

              有root權限安裝(可以連接外網)

              1、Nginx依賴-gcc

              1.1、gcc簡介

              Gcc(GNU C Compiler)是GNU推出的功能強大、性能優越的多平臺編譯器。安裝nginx需要通過Gcc工具進行編譯,生成ngixn的可執行的文件。

              1.2、檢測gcc安裝版本

              gcc -v

              未安裝: ![image.png](https://img-blog.csdnimg.cn/img_convert/a987b2abece2763b7f19552b412385b3.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=43&id=ub412a6bc&margin=[object Object]&name=image.png&originHeight=43&originWidth=303&originalType=binary&ratio=1&rotation=0&showTitle=false&size=2468&status=done&style=none&taskId=u46146848-35a7-48fb-ae84-37cdfec1538&title=&width=303) 已安裝: ![image.png](https://img-blog.csdnimg.cn/img_convert/82f44f012e7b246f8282c9135e151e05.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=226&id=tNGEm&margin=[object Object]&name=image.png&originHeight=226&originWidth=937&originalType=binary&ratio=1&rotation=0&showTitle=false&size=29865&status=done&style=none&taskId=u507643cf-a1a4-4628-8010-bfa4b5b83b9&title=&width=937)

              1.3、安裝gcc

              yum install gcc-c++

              ![image.png](https://img-blog.csdnimg.cn/img_convert/ac37e7b44c27512084d07bb35e3cbc93.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=185&id=u95a94a74&margin=[object Object]&name=image.png&originHeight=185&originWidth=743&originalType=binary&ratio=1&rotation=0&showTitle=false&size=12017&status=done&style=none&taskId=ue463621c-ab02-4261-ae66-ad6fa3b3e90&title=&width=743)

              2、Nginx依賴-pcre

              2.1、pcre簡介

              PCRE(Perl Compatible Regular Expressions) 是一個Perl庫,包括 perl 兼容的正則表達式庫。nginx 的 http 模塊使用 pcre 來解析正則表達式,所以需要在 linux 上安裝 pcre 庫,pcre-devel 是使用 pcre 開發的一個二次開發庫。nginx也需要此庫。

              2.2、檢測pcre安裝的版本

              rpm -qa pcre

              ![image.png](https://img-blog.csdnimg.cn/img_convert/8dbf2206284a2b01f542ee470fa1f3a7.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=69&id=u4e1d564b&margin=[object Object]&name=image.png&originHeight=69&originWidth=409&originalType=binary&ratio=1&rotation=0&showTitle=false&size=2978&status=done&style=none&taskId=u8819e0bb-5da8-4fba-a9a1-277d1621c04&title=&width=409)

              2.3、安裝pcre

              yum install -y pcre pcre-devel

              ![image.png](https://img-blog.csdnimg.cn/img_convert/950edad5246ea5034c32fb40831488cc.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=217&id=udf4c316b&margin=[object Object]&name=image.png&originHeight=217&originWidth=879&originalType=binary&ratio=1&rotation=0&showTitle=false&size=19210&status=done&style=none&taskId=u02ebf0d5-291f-4068-8aff-ee01112af6a&title=&width=879)

              3、Nginx依賴-zlib

              3.1、zlib簡介

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

              3.2、檢測zlib安裝的版本

              rpm -qa zlib

              ![image.png](https://img-blog.csdnimg.cn/img_convert/b7b619c1887008d1130b102ad9cb98b5.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=43&id=u09e690e1&margin=[object Object]&name=image.png&originHeight=43&originWidth=334&originalType=binary&ratio=1&rotation=0&showTitle=false&size=2262&status=done&style=none&taskId=u9e49d72f-2b6a-4039-b533-4653ce3f69b&title=&width=334)

              3.3、安裝zlib

              yum install -y zlib zlib-devel

              ![image.png](https://img-blog.csdnimg.cn/img_convert/5b330f3c8821e75dde167bd6e32ca390.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=185&id=u445cbb4f&margin=[object Object]&name=image.png&originHeight=185&originWidth=813&originalType=binary&ratio=1&rotation=0&showTitle=false&size=16191&status=done&style=none&taskId=u503c54b3-c07a-4af8-9739-4923d8afe28&title=&width=813)

              4、 Nginx依賴-OpenSSL

              4.1、OpenSSL 簡介

              OpenSSL 是一個強大的安全套接字層密碼庫,囊括主要的密碼算法、常用的密鑰和證書封裝管理功能及 SSL 協議,并提供豐富的應用程序供測試或其它目的使用。nginx 不僅支持 http 協議,還支持 https(即在ssl協議上傳輸http),所以需要在 Centos 安裝 OpenSSL 庫。

              4.2、檢測OpenSSL安裝版本

              rpm -qa|grep -i openssl

              ![image.png](https://img-blog.csdnimg.cn/img_convert/8f057cd78c6478cb61101a1fda56f787.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=78&id=u8e7057ad&margin=[object Object]&name=image.png&originHeight=78&originWidth=395&originalType=binary&ratio=1&rotation=0&showTitle=false&size=4828&status=done&style=none&taskId=u0295062e-b4b4-4086-9732-4876adf7fe4&title=&width=395)

              4.3、安裝OpenSSL

              yum install -y openssl openssl-devel

              ![image.png](https://img-blog.csdnimg.cn/img_convert/2291409473fae95efbe683ff77f39866.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=107&id=u32b1790b&margin=[object Object]&name=image.png&originHeight=107&originWidth=847&originalType=binary&ratio=1&rotation=0&showTitle=false&size=10212&status=done&style=none&taskId=uc8c8fcc1-6bdb-4a08-a490-67bd527280f&title=&width=847)

              5、下載nginx安裝包

              方式一:

              去官網(https://nginx.org/en/download.html),我這里選了nginx-1.18.0版本

              ![image.png](https://img-blog.csdnimg.cn/img_convert/e474e15c062051cc4d204407ebc953fe.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=595&id=u863ca5ca&margin=[object Object]&name=image.png&originHeight=595&originWidth=1088&originalType=binary&ratio=1&rotation=0&showTitle=false&size=77376&status=done&style=none&taskId=ufb7edda8-570c-46cf-b83e-6edb022c95e&title=&width=1088)

              方式二:

              使用wget命令下載(推薦):

              wget -c https://nginx.org/download/nginx-1.18.0.tar.gz

              ![image.png](https://img-blog.csdnimg.cn/img_convert/2e76f69e5a8d6185e46df04c1a445cb1.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=256&id=u0e1e6aff&margin=[object Object]&name=image.png&originHeight=256&originWidth=969&originalType=binary&ratio=1&rotation=0&showTitle=false&size=30819&status=done&style=none&taskId=ub27b1578-194c-42bb-815c-b6f6083307c&title=&width=969)

              6、解壓縮nginx壓縮包

              tar -xf nginx-1.18.0.tar.gz

              ![image.png](https://img-blog.csdnimg.cn/img_convert/9a2ea3f2a66e6b6988e588ad0cb3b9d4.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=63&id=uf949c379&margin=[object Object]&name=image.png&originHeight=63&originWidth=520&originalType=binary&ratio=1&rotation=0&showTitle=false&size=3135&status=done&style=none&taskId=u37942a89-9b3a-43da-b928-f4e4c262ae6&title=&width=520)

              7、去nginx解壓的目錄下執行編譯安裝

              依次執行如下命令

              cd nginx-18.0 ./configure make & make install

              ![image.png](https://img-blog.csdnimg.cn/img_convert/812526cee7ee48289bc6b0d78559a282.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=358&id=u18e9a04e&margin=[object Object]&name=image.png&originHeight=358&originWidth=610&originalType=binary&ratio=1&rotation=0&showTitle=false&size=28339&status=done&style=none&taskId=udc03f57a-93e1-4e14-9363-808d3784290&title=&width=610)

              使用whereis nginx 查看nginx的安裝路徑 ![image.png](https://img-blog.csdnimg.cn/img_convert/aaa51798b1a4533d67c59bcfe9dd8af2.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=106&id=u6062bffb&margin=[object Object]&name=image.png&originHeight=106&originWidth=522&originalType=binary&ratio=1&rotation=0&showTitle=false&size=7238&status=done&style=none&taskId=u00c7f349-5908-4413-85b3-a05a36080b7&title=&width=522) 8、啟動nginx,可以查看nginx的主頁 ![image.png](https://img-blog.csdnimg.cn/img_convert/0a60038a259f1fe6ce920a463358a17d.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=74&id=uf30520d5&margin=[object Object]&name=image.png&originHeight=74&originWidth=422&originalType=binary&ratio=1&rotation=0&showTitle=false&size=5064&status=done&style=none&taskId=u8fd83633-b787-4895-9a95-2ffe61b60fd&title=&width=422) ![image.png](https://img-blog.csdnimg.cn/img_convert/ed300fa4bc626f1fd121d261d3f0df44.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=705&id=ub6c582dd&margin=[object Object]&name=image.png&originHeight=705&originWidth=1382&originalType=binary&ratio=1&rotation=0&showTitle=false&size=62070&status=done&style=none&taskId=u27c9c972-c6bc-462f-b253-ea7d32e9e9c&title=&width=1382)

              Nginx–windows安裝

              1、直接進行解壓縮

              ![image.png](https://img-blog.csdnimg.cn/img_convert/655a4bc1379f4118fb3d65ea15ef1779.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=289&id=u23c27fc3&margin=[object Object]&name=image.png&originHeight=289&originWidth=723&originalType=binary&ratio=1&rotation=0&showTitle=false&size=21990&status=done&style=none&taskId=uabfe7615-410b-4417-901a-d9c466dce45&title=&width=723) 2、當前目錄下輸入cmd 打開黑框 ![image.png](https://img-blog.csdnimg.cn/img_convert/477579275ded5b691a1f60d705e23d60.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=661&id=u193f24fe&margin=[object Object]&name=image.png&originHeight=661&originWidth=1139&originalType=binary&ratio=1&rotation=0&showTitle=false&size=90780&status=done&style=none&taskId=u708589ac-ba79-4874-b750-3e4725d6fb9&title=&width=1139) 3、輸入.\nginx啟動 ![image.png](https://img-blog.csdnimg.cn/img_convert/0e315fc542a482ace8f25847aa8566db.png#clientId=ub6999b20-2a2b-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=519&id=u9f1104a7&margin=[object Object]&name=image.png&originHeight=519&originWidth=993&originalType=binary&ratio=1&rotation=0&showTitle=false&size=35047&status=done&style=none&taskId=u64a87999-82ef-4283-86e6-2ecb7731992&title=&width=993)

              責任編輯:

              標簽: 絕對路徑

              相關推薦:

              精彩放送:

              新聞聚焦
              Top 中文字幕在线观看亚洲日韩