linux 非root用戶安裝nginx


第一步:首先下載依賴包

下載地址 pcre(www.pcre.org),zlib(www.zlib.org),openssl(www.openssl.org)

 

第二步:上傳那個nginx的安裝包

下載nginx安裝包,解壓

 

[bdctool@localhost setup]$ tar  -zxvf nginx-1.12.2.tar.gz

[bdctool@localhost setup]$ ./configure  --with-http_stub_status_module --prefix=/opt/aspire/product/bdctool/nginx  

 報錯

./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.

3、還是安裝一下pcre吧

[bdctool@localhost setup]$ unzip  pcre-8.10.zip

[bdctool@localhost setup]$ cd  pcre-8.10

[bdctool@localhost pcre-8.10]$ ./configure    --prefix=/opt/aspire/product/bdctool/nginx/zzw_other/pcre-8.10 (自定義目錄)

[bdctool@localhost pcre-8.10]$ make

[bdctool@localhost pcre-8.10]$ make install

4、再來安裝nginx,首先./configure(這里是個坑,可以不操作,繼續往下看--轉載注)

 [bdctool@localhost nginx-1.12.2]$./configure  --with-http_stub_status_module  --prefix=/opt/aspire/product/bdctool/nginx  --with-pcre=/opt/aspire/product/bdctool/nginx/zzw_other/pcre-8.10

 

注意:上面命令--prefix=路徑為nginx想要安裝到的目錄, --with-pcre=路徑為pcre安裝到的目錄。

 

5、修改 --with-pcre=后的路徑為pcre的解壓后的源路徑,重新./configure 

 [bdctool@localhost nginx-1.12.2]$./configure  --with-http_stub_status_module  --prefix=/opt/aspire/product/bdctool/nginx  --with-pcre=/opt/aspire/product/bdctool/setup/pcre-8.10(注意這個是pcre的源碼路徑

 

原文路徑:https://blog.csdn.net/lzs_xiaoze/article/details/85632144

6,執行make 命令

7,執行make install 命令來着

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM