安装nginx,下完tar.gz包,tar -zxvf后,./configure,遇到一个问题
/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=<path> option.
在这网站上下了所缺失的pcre-devel-8.12-4.fc16.i686.rpm
http://rpm.pbone.net/index.php3/stat/3/srodzaj/1/search/pcre-devel
安装此包:
[root@ShadowFiend 下载]# rpm -ivh pcre-devel-8.12-4.fc16.i686.rpm
error: Failed dependencies:
pcre = 8.12-4.fc16 is needed by pcre-devel-8.12-4.fc16.i686
[root@ShadowFiend 下载]# rpm -ivh pcre-devel-8.12-4.fc16.i686.rpm --nodeps
Preparing... ########################################### [100%]
1:pcre-devel ########################################### [100%]
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
在服务器安装提示的另一个错误,nginx的安装需要gcc,openssl-devel,pcre-devel,zlib-devel,正常除了pcre-devel,其他3个都是系统自带的,但是服务器上缺少了,zlib-devel.
./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=<path> option.
slove:
[root@fzo-501 nginx-1.0.2]# yum install zlib-devel
time:20120307
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
再次
./configure
,
没有问题了,configure结果如下:
Configuration summary
+ using system PCRE library
+ OpenSSL library is not used
+ md5: using system crypto library
+ sha1 library is not used
+ using system zlib library
nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
接着
make
结果如下:
make[1]: Leaving directory `/home/Gogo_yueyue/下载/nginx-1.0.2'
make -f objs/Makefile manpage
make[1]: Entering directory `/home/Gogo_yueyue/下载/nginx-1.0.2'
sed -e "s|%%PREFIX%%|/usr/local/nginx|" \
-e "s|%%PID_PATH%%|/usr/local/nginx/logs/nginx.pid|" \
-e "s|%%CONF_PATH%%|/usr/local/nginx/conf/nginx.conf|" \
-e "s|%%ERROR_LOG_PATH%%|/usr/local/nginx/logs/error.log|" \
< man/nginx.8 > objs/nginx.8
make[1]: Leaving directory `/home/Gogo_yueyue/下载/nginx-1.0.2'
接着
make install
基本操作:
[Gogo_yueyue@ShadowFiend ~]$ /usr/local/nginx/sbin/nginx -h
nginx: nginx version: nginx/1.0.2
nginx: Usage: nginx [-?hvVtq] [-s signal] [-c filename] [-p prefix] [-g directives]
Options:
-?,-h : this help
-v : show version and exit
-V : show version and configure options then exit
-t : test configuration and exit
-q : suppress non-error messages during configuration testing
-s signal : send signal to a master process: stop, quit, reopen, reload
-p prefix : set prefix path (default: /usr/local/nginx/)
-c filename : set configuration file (default: conf/nginx.conf)
-g directives : set global directives out of configuration file