日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

编译nginx源码包

發布時間:2023/12/14 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 编译nginx源码包 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

源碼包指的是開發編寫好的程序源代碼,但并沒有將其編譯為一個能正常使用的二進制工具,部分軟件官網僅提供源碼包,需要自行編譯并安裝,下面以nginx1.21.1版本為例;

1.下載源碼包

在官網https://nginx.org/en/download.html找到源碼包,復制鏈接地址下載:

[root@localhost data]# wget https://nginx.org/download/nginx-1.21.1.tar.gz

2.解壓源碼包,并進入目錄

[root@localhost data]# tar xf nginx-1.21.1.tar.gz [root@localhost data]# cd nginx-1.21.1

3.基礎環境準備,先安裝一些需要的環境

3.基礎環境準備[root@localhost ~]# yum install -y gcc make

4.配置相關選項,生成makefile,中間會出現錯誤,需要安裝相關軟件包

[root@localhost nginx-1.21.1]# ./configure --prefix=/usr/local/nginx-1.21.1 --with-http_ssl_module --with-http_stub_status_module ./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre=<path> option. [root@localhost nginx-1.21.1]# yum install -y pcre-devel zlib-devel ./configure: error: SSL modules require the OpenSSL library. You can either do not enable the modules, or install the OpenSSL library into the system, or build the OpenSSL library statically from the source with nginx by using --with-openssl=<path> option. [root@localhost nginx-1.21.1]# yum install openssl openssl-devel -y [root@localhost nginx-1.21.1]# ./configure --prefix=/usr/local/nginx-1.21.1 --with-http_ssl_module --with-http_stub_status_module

?5.編譯并把相關文件釋放到目錄

[root@localhost nginx-1.21.1]# make && make install

6.創建軟鏈接

[root@localhost nginx-1.21.1]# ln -s /usr/local/nginx-1.21.1/ /usr/local/nginx

7.啟動nginx

[root@localhost nginx-1.21.1]# /usr/local/nginx/sbin/nginx

8.從瀏覽器訪問虛擬機地址10.0.0.100顯示?,配置成功

?

總結

以上是生活随笔為你收集整理的编译nginx源码包的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。