nginx 安装问题

安装nginx报错

按理来说,装个nginx是很简单的,诸如用:yum install nginx,这个确实没什么问题,可是我想通过编译源码的方式安装,而且还要开启一些功能,例如:pcre zlib openssl。

开始把pcre(www.pcre.org),zlib(www.zlib.org),openssl(www.openssl.org) 都下载,编译安装好了,然后开始编译安装nginx-0.8.53。

./configure –prefix=/usr/local/nginx –user=www –group=www –with-http_gzip_static_module –with-http_stub_status_module –with-http_ssl_module –with-pcre=/usr/local/pcre –with-zlib=/usr/local/zlib –with-openssl=/usr/local/openssl –with-http_realip_module

这步没什么问题,接下来make,问题出来了:

cd /usr/local/pcre \
&& if [ -f Makefile ]; then make distclean; fi \
&& CC=”gcc” CFLAGS=”-O2 -fomit-frame-pointer -pipe ” \
./configure –disable-shared
/bin/sh: ./configure: No such file or directory
make[1]: *** [/usr/local/pcre/Makefile] Error 127
make[1]: Leaving directory `/software/nginx-0.8.53′
make: *** [build] Error 2

怎么捣鼓也没搞定,无意间 ./configure –help

看一下帮助说明:

–with-pcre=DIR set path to PCRE library sources

注意:set path to PCRE library sources是让你设置到源码目录,而不是编译安装后的目录,顿时恍然大悟。

迅速把上面几个依赖包的路径都改成源码路径:

./configure –prefix=/usr/local/nginx –with-http_gzip_static_module –with-http_stub_status_module –with-http_ssl_module –with-pcre=/software/pcre-8.10 –with-zlib=/software/zlib-1.2.5 –with-openssl=/software/openssl-1.0.0a –with-http_realip_module

重新执行,OK。

文章来源:http://hi.baidu.com/mchina_tang/item/0c3d00941e28775df042153d

作者: 二皮

Hackers please go away