首頁  >  文章  >  後端開發  >  ubuntu 編譯 nginx

ubuntu 編譯 nginx

WBOY
WBOY原創
2016-08-08 09:32:05909瀏覽

一鍵編譯安裝nginx

#nginx地址官网安装
cd /opt/ && wget http://nginx.org/download/nginx-1.7.9.tar.gz && tar xvf nginx-1.7.9.tar.gz  && cd nginx-1.7.9 && sudo apt-get install -y libpcre3 libpcre3-dev libssl-dev && ./configure && make && make install


#githubdi地址安装
cd /opt/ && wget https://github.com/nginx/nginx/archive/master.zip && unzip master.zip  && cd  nginx-master && sudo apt-get install -y libpcre3 libpcre3-dev libssl-dev && ./configure && make && make install

分步安裝

1、取得下載位址


2、下載

、壓解目錄

5、缺少pcre包依賴 報錯

./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 . 或 build the PCRE library statically from the source with nginx by using --with-pcre= option


6、新增pcre包依賴


: requires the zlib library. You can either disable the module by using –without-http_gzip_module option, or install the zlib library into the system, or build the zlib library statically from the source with ntically from the source with nx by using –with-zlib= option.


8、新增zlib套件依賴(安裝libssl-dev libssl-dev依賴zlib1g-dev包自動下載)


關係檢查正常


10、編譯並安裝


11、安裝成功


11、安裝成功

是否已啟動


vim 退出指令:q  或切入後台模式ctrl+z  回到主機指令台

以上就介紹了ubuntu 編譯 nginx,包含了面向的內容,希望對PHP教學有興趣的朋友有幫助。

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn