日期:2014-05-16  浏览次数:20604 次

Linux下安装nginx时注意事项

1、下载最新的稳定版

?

wget http://nginx.org/download/nginx-1.0.6.tar.gz

??

?

2、执行如下命令

?

tar zxf nginx-1.0.6.tar.gz
cd nginx-1.0.6
./configure --prefix=/usr/local/nginx1.0.6
make
make install

?

3、如果在./configure时出现:

the HTTP rewrite module requires the PCRE library

则检查系统是否安装了pcre-devel包,

? ? ? ?可以使用:

? ? ? ?yum install pcre-devel

4、如果提示:

? ??error: the HTTP cache module requires md5 functions from OpenSSL library.

?

? ? 可以使用:

? ?yum install openssl openssl-devel

?

5、如果没有yum,方法如下:

?

?

? ? 去 ??http://www.pcre.org/ 下载最新版文件

?

? ?解压到服务器指定目录,并

? ?./configure --prefix=/usr/local/pcre8.12,让pcre生成Makefiles文件

?

之后,进入nginx安装目录,执行:

?

?

./configure --prefix=/usr/local/nginx1.0.6 -with-pcre=/usr/local/pcre8.12
make
make install
?

?