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

  • 相关阅读:
    8.图形软件开发
    7.GDI绘图技术
    15.MFC网络通信
    JavaWeb:基于MVC设计模式的一个小案例(一)
    在虚拟机里连接PLC S7-200
    mark-又重新回到博客园
    早起的奇迹
    STM32-cJSON库的打包和解析
    Copley-STM32串口+CANopen实现双电机力矩同步
    DataStructure-链表实现指数非递减一元多项式的求和
  • 原文地址:https://www.cnblogs.com/toSeeMyDream/p/5445550.html
Copyright © 2011-2022 走看看