首頁  >  文章  >  後端開發  >  linux下安裝nginx-180

linux下安裝nginx-180

WBOY
WBOY原創
2016-07-30 13:30:501086瀏覽

1.下載網址:http://nginx.org/en/download.html

選擇nginx-1.8.0

2.安裝

tar zxvf nginx-1.8.0.tar.gz
cd nginx-1.8.0/
./configure --prefix=/home/wangpl/mine/soft/nginx-1.8.0 error:
./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 in PCR the buil statically from the source with nginx by using --with-pcre= option.
意思是rewrite模組所需的pcre沒有找到,需要指定--with-pcre=
可以參考:http://blog .csdn.net/conquer0715/article/details/42555723
安裝pcre
從http://pcre.org/下載:pcre-8.36.tar.gz
tar zxvf pcre-8.36.tar.gz
. 8.36
./configure --prefix=/home/soft/pcre-8.36
make
make install
繼續nginx安裝(這裡直接停用rewrite模組):
./configure --prefix=/home/wangpl/mine/soft /nginx-1.8.0 --without-http_rewrite_module
安裝完成
相比Apache httpd簡單多了,不到3MB,當然功能也相對少點,網上說性能較Apache要好,但穩定性要差點。


3.試試

cd /home/wangpl/mine/soft/nginx-1.8.0/sbin

./nginx

訪問:http://127.0.0.1:7000/

訪問:http://127.0.0.1:7000/

表示啟動成功:

Welcome to nginx!

停止nginx:

./nginx -s stop

版權聲明:本文為部落客原創文章,未經部落客允許不得轉載。

以上就介紹了linux下安裝nginx-180,包含了方面的內容,希望對PHP教學有興趣的朋友有幫助。

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