先 ./configure 一下,按原来的路径配置,自己需要的包打上,基本上没啥,基本功能nginx都自带了。
然后make,但不要install
编译完,在objs目录下有一个nginx执行文件,就是它了。
备份下原来老的nginx文件
mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old
在把新objs下的nginx cp到sbin下。
nginx -t 测试下,显示通过。
//让nginx把nginx.pid改成nginx.pid.oldbin 跟着启动新的nginx
# kill -USR2 `cat /usr/local/nginx/nginx.pid`
//退出旧的nignx
# kill -QUIT `cat /usr/local/nginx/nginx.pid.oldbin`
升级完成!
参考:
======================================================
注:当升级时想要添加--with-http_perl_module perl支持时,光做上面的操作是不行的,因为添加了上面的编译选项后nginx还需要添加一些文件到perl中。
下面是make install做的工作,可见安装了一些perl所需的文件,所以,解决这个问题的办法就是在另外一个目录安装一个一样编译选项的nginx,这样就会将需要的perl文件安装好了。(因为红色部分所做的操作,所以使用没有手动拷贝perl的文件)
[root@srv3 nginx-0.7.65]# make install
make -f objs/Makefile install
make[1]: Entering directory `/opt/nginx-0.7.65'
cd objs/src/http/modules/perl && make install
make[2]: Entering directory `/opt/nginx-0.7.65/objs/src/http/modules/perl'
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/nginx/nginx.bs
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/nginx/nginx.so
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/nginx.pm
Installing /usr/share/man/man3/nginx.3pm
Writing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/nginx/.packlist
Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod
make[2]: Leaving directory `/opt/nginx-0.7.65/objs/src/http/modules/perl'
test -d '/usr/local/nginx111' || mkdir -p '/usr/local/nginx111'
test -d '/usr/local/nginx111/sbin' || mkdir -p '/usr/local/nginx111/sbin'
test ! -f '/usr/local/nginx111/sbin/nginx' || mv '/usr/local/nginx111/sbin/nginx' '/usr/local/nginx111/sbin/nginx.old'
cp objs/nginx '/usr/local/nginx111/sbin/nginx'
test -d '/usr/local/nginx111/conf' || mkdir -p '/usr/local/nginx111/conf'
cp conf/koi-win '/usr/local/nginx111/conf'
cp conf/koi-utf '/usr/local/nginx111/conf'
cp conf/win-utf '/usr/local/nginx111/conf'
test -f '/usr/local/nginx111/conf/mime.types' || cp conf/mime.types '/usr/local/nginx111/conf'
cp conf/mime.types '/usr/local/nginx111/conf/mime.types.default'
test -f '/usr/local/nginx111/conf/fastcgi_params' || cp conf/fastcgi_params '/usr/local/nginx111/conf'
cp conf/fastcgi_params '/usr/local/nginx111/conf/fastcgi_params.default'
test -f '/usr/local/nginx111/conf/fastcgi.conf' || cp conf/fastcgi.conf '/usr/local/nginx111/conf'
cp conf/fastcgi.conf '/usr/local/nginx111/conf/fastcgi.conf.default'
test -f '/usr/local/nginx111/conf/nginx.conf' || cp conf/nginx.conf '/usr/local/nginx111/conf/nginx.conf'
cp conf/nginx.conf '/usr/local/nginx111/conf/nginx.conf.default'
test -d '/usr/local/nginx111/logs' || mkdir -p '/usr/local/nginx111/logs'
test -d '/usr/local/nginx111/logs' || mkdir -p '/usr/local/nginx111/logs'
test -d '/usr/local/nginx111/html' || cp -r html '/usr/local/nginx111'
test -d '/usr/local/nginx111/logs' || mkdir -p '/usr/local/nginx111/logs'
make[1]: Leaving directory `/opt/nginx-0.7.65'
|
阅读(1949) | 评论(0) | 转发(0) |