linux下安裝nginx-180

來源:互聯網
上載者:User
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教程有興趣的朋友有所協助。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.