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=
意思是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教學有興趣的朋友有幫助。