zoukankan      html  css  js  c++  java
  • linux中nginx的安装,linux的版本是ubutu

    linux环境下,安装nginx,报错如下:

    the HTTP rewrite module requires the PCRE library.

     1.需要安装pcre,报一下错误:

    you need a c++ compiler

        解决方法:安装c++编译器:

    sudo apt-get install build-essential

    2.configure,make之后报一下错误

    /home/user/Downloads/pcre-8.36/missing: line 81: aclocal-1.14: command not found
    WARNING: 'aclocal-1.14' is missing on your system.
             You should only need it if you modified 'acinclude.m4' or
             'configure.ac' or m4 files included by 'configure.ac'.
             The 'aclocal' program is part of the GNU Automake package:
             <http://www.gnu.org/software/automake>
             It also requires GNU Autoconf, GNU m4 and Perl in order to run:
             <http://www.gnu.org/software/autoconf>
             <http://www.gnu.org/software/m4/>
             <http://www.perl.org/>
    make: *** [aclocal.m4] Error 127

    3.安装auto-make

      1):在软件中心安装以下autotools-dev、automake、 autoconf2.13、m4、perl、libperl5.14、libtool

      2):在pcre解压包下执行以下命令 sudo autoreconf -ivf

           关于autoreconf:autoconf能够用来执行项目所需的autoconf、automake和libtool包中的配置工具。设计autoreconf的目的是为了减少重新生成配置脚本所需要的时间。这是通过基于时间戳,如果你只有一个configure.ac文件,这将会生成配置脚本,运行脚本以及运行make。

    4.安装pcre:make,make install

    5.安装nginx,提示缺少zlib,安装zlib:

    sudo apt-get install zlib1g-dev
    

     6.继续安装nginx,成功,开始启动nginx,报出错误如下:

    /usr/local/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
    

       查找关联关系:

    [root @localhost conf]# ldd $(which /usr/local/nginx/sbin/nginx)
    linux-gate.so.1 =>  (0x0071b000)
    libpthread.so.0 => /lib/libpthread.so.0 (0×00498000)
    libcrypt.so.1 => /lib/libcrypt.so.1 (0×00986000)
    libpcre.so.1 => not found
    libcrypto.so.6 => /lib/libcrypto.so.6 (0×00196000)
    libz.so.1 => /lib/libz.so.1 (0×00610000)
    libc.so.6 => /lib/libc.so.6 (0x002d7000)
    /lib/ld-linux.so.2 (0x006a8000)

      显示缺少libpcre.so.1, 在lib下建立pcre.so.1的软连接:

      ln -s /usr/local/lib/libpcre.so.1 /lib
    

    7.继续启动nginx

       ./nginx

  • 相关阅读:
    解决IE 下div与img重叠无法触发鼠标事件的问题
    四边相同阴影效果
    dedecms 获取文章发布时间和获取文章最后更新时间
    局域网访问网站
    HTML 5 的data-* 自定义属性
    yum 安装 influxdb/telegraf
    zabbix 监控 AWS-SQS 队列
    解决阿里云部署 office web apps ApplicationFailedException 报错问题
    jira集成fisheye代码深度查看工具安装绿色版
    阿里云ecs开启x11图形化桌面
  • 原文地址:https://www.cnblogs.com/toSeeMyDream/p/5445550.html
Copyright © 2011-2022 走看看