您的位置:首页 > 运维架构 > Nginx

Linux下升级Nginx版本

2015-08-26 14:06 826 查看
版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。 本文链接:https://blog.csdn.net/php998/article/details/48002543

1.下载新版本nginx包

http://nginx.org/en/download.html

2.获取旧版本nginx的configure选项

/opt/nginx/sbin/nginx -V

3.进入新版本nginx解压后的目录,初始编译nginx,编译参数为第2步获取到的旧版本的参数

4.编译遇错(1)


解决方法:

ubuntu下执行

apt-get install libpcre3-dev

RHEL下执行

yum -y install pcre-devel

5.编译遇错(2)

./configure: error: the HTTP XSLT module requires the libxml2/libxslt

libraries. You can either do not enable the module or install the libraries.

解决办法:

Ubuntu

sudo apt-get install libxml2 libxml2-dev

RHEL

yum install libxslt-devel

6.遇错(3)

./configure: error: the HTTP image filter module requires the GD library.

You can either do not enable the module or install the libraries.

解决办法:

Ubuntu

yum install gd-devel

RHEL

apt-get install libgd2-xpm libgd2-xpm-dev

7.遇错(4)

./configure: error: perl module ExtUtils::Embed is required

解决办法:

yum install perl perl-devel perl-ExtUtils-Embed

8.遇错(5)

./configure: error: the GeoIP module requires the GeoIP library.

You can either do not enable the module or install the library.

解决办法:

Ubantu

sudo apt-get install geoip-database libgeoip-dev

RHEL

yum install GeoI GeoIP-data GeoIP-devel

9.编译

make

10.拷贝命令

mv /usr/sbin/nginx  /usr/sbin/nginx.1.2.0.bak

cp /opt/nginx-1.6.3/objs/nginx  /usr/sbin/nginx

11.编译安装

make install

12.重启nginx

service nginx restart


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: