CentOS升级Nginx

分类:CentOS教程 阅读:43870 次

1、下载最新nginx

  1. wgethttp://nginx.org/download/nginx-1.5.11.tar.gz

2、查看nginx版本

  1. /usr/local/nginx/sbin/nginx-V

  1. nginxversion:nginx/1.4.2
  2. builtbygcc4.4.720120313(RedHat4.4.7-3)(GCC)
  3. configurearguments:--prefix=/usr/local/nginx

3、nginx升级安装

  1. tar-zxvfnginx-1.4.3.tar.gz
  2. cdnginx-1.4.3/
  3. ./configure--prefix=/usr/local/nginx
  4. make

4、配置

  1. mv/usr/local/nginx/sbin/nginx/usr/local/nginx/sbin/nginx.old
将新编译好的 nginx 复制到 nginx 的目录中
  1. cpobjs/nginx/usr/local/nginx/sbin/nginx
重启 nginx 完成升级
  1. /usr/local/nginx/sbin/nginx-V
  2. nginxversion:nginx/1.4.2
  3. builtbygcc4.4.720120313(RedHat4.4.7-3)(GCC)
  4. configurearguments:--prefix=/usr/local/nginx