今天接到nginx 邮件通知,nginx 0.9.x 开发分支的第一个版本发布了.想想看nginx 0.8.x 进入稳定分支没几天,作者又开始了,真是闲不住呀.而我的nginx 现在还停在 0.8.50,连稳定版都没赶上,本来就打算升级的,这下正好,直接进 0.9.x 了.
下载最新的源码包,解压,进入目录
我的configure:
[root@PowerPC nginx-0.9.0]# ./configure \
> --prefix=/usr/local/nginx \
> --sbin-path=/usr/local/sbin/nginx \
> --conf-path=/etc/sysconfig/nginx/nginx.conf \
> --error-log-path=/var/log/nginx/error.log \
> --pid-path=/var/run/nginx.pid \
> --lock-path=/var/run/nginx.lock \
> --user=http \
> --group=web \
> --with-select_module \
> --with-poll_module \
> --with-http_xslt_module \
> --with-http_flv_module \
> --with-http_gzip_static_module \
> --without-http_geo_module \
> --without-http_map_module \
> --without-http_fastcgi_module \
> --without-http_uwsgi_module \
> --without-http_scgi_module \
> --http-log-path=/var/log/nginx/access.log \
> --http-client-body-temp-path=/tmp/nginx/proxy.tmp \
> --http-proxy-temp-path=/tmp/nginx/body.tmp \
> --without-mail_pop3_module \
> --without-mail_imap_module \
> --without-mail_smtp_module
检查依赖,没有任何问题. 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/sbin/nginx"
nginx configuration prefix: "/etc/sysconfig/nginx"
nginx configuration file: "/etc/sysconfig/nginx/nginx.conf"
nginx pid file: "/var/run/nginx.pid"
nginx error log file: "/var/log/nginx/error.log"
nginx http access log file: "/var/log/nginx/access.log"
nginx http client request body temporary files: "/tmp/nginx/body.tmp"
nginx http proxy temporary files: "/tmp/nginx/proxy.tmp"
在确认安装路径和配置路径等等都没有问题后,make 编译.接下来安装至指定目录, make install.(复制一些二进制文件和配置文件 以及man手册……)
make[1]: Entering directory `/root/nginx-0.9.0'
test -d '/usr/local/nginx' || mkdir -p '/usr/local/nginx'
test -d '/usr/local/sbin' || mkdir -p '/usr/local/sbin'
test ! -f '/usr/local/sbin/nginx' || mv '/usr/local/sbin/nginx' '/usr/local/sbin/nginx.old'
cp objs/nginx '/usr/local/sbin/nginx'
test -d '/etc/sysconfig/nginx' || mkdir -p '/etc/sysconfig/nginx'
cp conf/koi-win '/etc/sysconfig/nginx'
cp conf/koi-utf '/etc/sysconfig/nginx'
cp conf/win-utf '/etc/sysconfig/nginx'
test -f '/etc/sysconfig/nginx/mime.types' || cp conf/mime.types '/etc/sysconfig/nginx'
cp conf/mime.types '/etc/sysconfig/nginx/mime.types.default'
test -f '/etc/sysconfig/nginx/fastcgi_params' || cp conf/fastcgi_params '/etc/sysconfig/nginx'
cp conf/fastcgi_params '/etc/sysconfig/nginx/fastcgi_params.default'
test -f '/etc/sysconfig/nginx/fastcgi.conf' || cp conf/fastcgi.conf '/etc/sysconfig/nginx'
cp conf/fastcgi.conf '/etc/sysconfig/nginx/fastcgi.conf.default'
test -f '/etc/sysconfig/nginx/uwsgi_params' || cp conf/uwsgi_params '/etc/sysconfig/nginx'
cp conf/uwsgi_params '/etc/sysconfig/nginx/uwsgi_params.default'
test -f '/etc/sysconfig/nginx/scgi_params' || cp conf/scgi_params '/etc/sysconfig/nginx'
cp conf/scgi_params '/etc/sysconfig/nginx/scgi_params.default'
test -f '/etc/sysconfig/nginx/nginx.conf' || cp conf/nginx.conf '/etc/sysconfig/nginx/nginx.conf'
cp conf/nginx.conf '/etc/sysconfig/nginx/nginx.conf.default'
test -d '/var/run' || mkdir -p '/var/run'
test -d '/var/log/nginx' || mkdir -p '/var/log/nginx'
test -d '/usr/local/nginx/html' || cp -r html '/usr/local/nginx'
test -d '/var/log/nginx' || mkdir -p '/var/log/nginx'
make[1]: Leaving directory `/root/nginx-0.9.0'
至此,安装完成.
将之前备份的配置文件覆盖同名文件 /etc/sysconfig/nginx/nginx.conf,且确保存在可被写入的文件夹 /tmp/nginx.即可启动 nginx.
本地测试一下,
[root@PowerPC nginx]# curl localhost:83
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/0.9.0</center>
</body>
</html>
查看下版本,
[root@PowerPC nginx]# nginx -v
nginx: nginx version: nginx/0.9.0
恩,一切OK.