nginx 安装

安装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
[url]http://rpm.pbone.net/index.php3/stat/3/srodzaj/1/search/pcre-devel[/url]
安装此包:
[code="linux"]
# 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
# rpm -ivh pcre-devel-8.12-4.fc16.i686.rpm --nodeps
Preparing... ########################################### [100%]
1:pcre-devel ########################################### [100%]
[/code]
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
在服务器安装提示的另一个错误,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:
[code="linux"]

# yum install zlib-devel

time:20120307
[/code]


--------------------------------------------------------------------------------------------------------------------------------------------------------------------
再次


./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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值