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 into the system, or build the PCRE library
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
cd xx/pcre-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/
看到以下結果表示啟動成功:
Welcome to nginx!
停止nginx:
./nginx -s stop
著作權聲明:本文為博主原創文章,未經博主允許不得轉載。
以上就介紹了linux下安裝nginx-180,包括了方面的內容,希望對PHP教程有興趣的朋友有所協助。