一个伪linux粉丝的blog

  1. 首页
  2. network
  3. 正文

nginx升级0.8.52

9 10 月, 2010 6419点热度 0人点赞 3条评论

某台vps上的nginx版本nginx/0.6.32,够老了,升级到0.7.67系列也不过瘾了,呵呵,干脆直接升级最新稳定版0.8.52.

升级过程记录一下

首先当然是下载源码,因为现在还没有nginx 0.8.52的deb源

  1. wget http://nginx.org/download/nginx-0.8.52.tar.gz
  2. tar zxvf nginx-0.8.52.tar.gz

    cd nginx-0.8.52

  3. 愿意改版本信息的可以去修改
  4. 编辑“src/core/nginx.h”

    随意修改 以下字段

    #define NGINX_VERSION

    #define NGINX_VER

  5. 关闭debug模式,据说可以减少nginx文件的大小
  6. 编辑“auto/cc/gcc”:

    找到这行,注释掉以下代码:

    #CFLAGS="$CFLAGS -g"

  7. 开始编译,但千万不要"make install":
    ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module
    make
  8. make时提示缺失 prec 库
  9. ./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=
    option.

    那就安装呗,呵呵 apt-get install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev

  10. 备份原来的 nginx 文件
    mv /usr/sbin/nginx /usr/sbin/nginx.old
  11. 复制编译好的 nginx 文件到/usr/sbin/nginx
  12. cp objs/nginx /usr/sbin/nginx

  13. 检测nginx文件配置 nginx -t
  14. 测试成功,则直接重启nginx
    /etc/init.d/nginx restart

后记,实在是很少编译,结果好几个目录路径缺失,只好手工补上了。汗:-)

相关文章:

  1. 安装Nginx
  2. 基于Ubuntu Nginx Mongrel Mysql部署rails
  3. how to install open source Tengine
  4. Moving WordPress blog to a new server
标签: Nginx
最后更新:9 10 月, 2010

wanjie

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

  • photon

    # 复制编译好的 nginx 文件到/usr/sbin/nginx

    cp objs/nginx /usr/sbin/nginx
    ----------------------------------------

    为什么要这样做而不是直接make install?

    10 10 月, 2010
    回复
    • wanjie

      @photon 因为前面是网上的那种lnmp一键安装包装的,比较乱,不敢直接安装替换。其实我很少编译的,习惯了deb包。哈哈。

      10 10 月, 2010
      回复
  • adsense tricks

    I really like your topic and appreciate your work.it is so interesting for me because it provides nice infos so I' bookmarked it.thank you for sharing this topic.

    27 2 月, 2011
    回复
  • razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
    取消回复

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    归档
    分类
    • network / 332篇
    • Uncategorized / 116篇
    • unix/linux / 121篇
    • 业界资讯 / 38篇
    • 公司杂事 / 11篇
    • 数码影像 / 12篇
    • 美剧 / 3篇
    • 美图共赏 / 21篇
    • 英语学习 / 3篇
    标签聚合
    postgres Google debian squid Nginx google-chrome 虚拟主机 d90 kernel openssl wget deepseek nexus jira ldap k8s kubectl 泰国 天翼live Ubuntu 网站运营 邮件归档 gitlab VPS ssh Google Voice docker dreamhost dreamhost空间 浏览器

    COPYRIGHT © 2008-2025 wanjie.info. ALL RIGHTS RESERVED.

    Theme Kratos Made By Seaton Jiang