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

linux中nginx的安装,linux的版本是ubutu的更多相关文章

  1. Linux中nginx手动安装

    本分类下有一个环境一键安装.那这背后发生了什么呢?咱们手动使用源码进行安装. 1.首先保证有一个能联网的centos. 2.百度 ningx 官网   点download  http://nginx. ...

  2. Linux中Nginx安装与配置详解

    转载自:http://www.linuxidc.com/Linux/2016-08/134110.htm Linux中Nginx安装与配置详解(CentOS-6.5:nginx-1.5.0). 1 N ...

  3. linux中Nginx安装

    linux中Nginx安装 编译安装 ​ Nginx的优点太多,这里不再赘述,详情请看这篇博客深入理解nginx. ​ Nginx的安装有rpm包安装.编译安装和docker安装.本文将介绍编译安装方 ...

  4. linux中nginx、mysql安装碰到的问题

    服务器到期新买了一台服务器,记录一下重新安装基本环境碰到了一些问题 安装nginx 1. 启动失败 403 forbidden nginx 解决方案:(个人使用直接用了root账号,修改对应nginx ...

  5. Linux下nginx编译安装教程和编译参数详解

    这篇文章主要介绍了Linux下nginx编译安装教程和编译参数详解,需要的朋友可以参考下 一.必要软件准备1.安装pcre 为了支持rewrite功能,我们需要安装pcre 复制代码代码如下: # y ...

  6. linux中mariadb的安装

    在Linux中mariaDB的安装 MariaDB其实就是MySQL的分支,是为了应对MySQL的即将的闭源风险所产生的. Linux系统中软件包的格式为mysql.rpm格式. 通过yum去安装 L ...

  7. Linux中源码安装编译Vim

    Linux中源码安装编译Vim Linux下学习工作少不了编辑器,Vim能使你的工作效率成倍的提高.在Ubuntu上安装vim使用命令直接安装很简单.但有时还是需要自己手动编译安装.例如: vim中的 ...

  8. linux中nginx重定向方法总结

    linux中nginx 301重定向跳转方法总结 第一种情况:访问aaaaaaa站定向到bbbbbbbbbbb站 复制代码代码如下: server { server_naaaaaaame www.aa ...

  9. Linux中编译、安装nginx

    Nginx ("engine x") 是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP 代理服务器. Nginx 是由Igor Sysoev为俄罗斯访问 ...

随机推荐

  1. android .9文件的一点处理

    Android上面有很多平台,造成比较严重的碎片问题,适配比较困难,作为应用,一般都需要图文并茂,图片又是比较占资源的.面对缩放的问题,于是出来了矢量图片文件,作一点矢量处理,于是就是.9图片,IOS ...

  2. java log日志的输出。

    在Spring框架中添加日志功能: pom.xml <dependency> <groupId>log4j</groupId> <artifactId> ...

  3. 多个线程访问url

    多个线程访问url package com.aig.ecompassios.ecard; import java.io.BufferedReader; import java.io.InputStre ...

  4. Python入门 学习笔记 (一)

    原文地址:http://www.cnblogs.com/lujianwenance/p/5939786.html 说到学习一门语言第一步就是先选定使用的工具(环境).因为本人是个小白,所以征求了一下同 ...

  5. c#中的重写方法与隐藏方

    1.父类中有方法a,添加virtua修饰符可声明为虚方法,在子类中可以用override声明后重写方法a. 2.父类中有方法a,在子类中可以有new修饰符声明后隐藏父类方法. 子类重写方法后,对于子类 ...

  6. 类库探源——System.Drawing.Bitmap

    一.System.Drawing.Bitmap Bitmap 类: 封装GDI+ 位图,此位图由图形图像及其属性的像素数据组成.Bitmap 是用于处理由像素定义的图像的对象 命名空间: System ...

  7. jeesite 经常出现java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderL解决思路

    本来jeesite是用的maven,但是我开发的项目用这个框架没用maven, 经常报这个错,我能用的办法就是将springmvc—web.jar包删掉,然后重新添加

  8. easyui-helloworld

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  9. CCPC网赛,HDU_5832 A water problem

    Problem Description           Two planets named Haha and Xixi in the universe and they were created ...

  10. groovy --不注意的小错误(java.lang.String.positive() is applicable)

    sql 语句拼接报错: No signature of method: java.lang.String.positive() is applicable for argument types: () ...