Rumah  >  Artikel  >  pembangunan bahagian belakang  >  linux下安装nginx-180

linux下安装nginx-180

WBOY
WBOYasal
2016-07-30 13:30:501083semak imbas

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教程有兴趣的朋友有所帮助。

Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Artikel sebelumnya:初识nginx之准备工作Artikel seterusnya:php 设计模式(转载)