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. temporary

    private void OnAttendeeConnected(object pObjAttendee) { IRDPSRAPIAttendee pAttendee = pObjAttendee a ...

  2. 安装完oracle重新启动后报ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务(重启前正常)

    安装完oracle重新启动后报ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务(重启前正常) 刚安装完后用plSql登录正常. 在dos命令行下 输入  sqlplus 用户 ...

  3. 关于GC进行垃圾回收的时机

    前言 今天查看一个同事的代码,发现代码中多处地方使用了GC.Collect()方法,我问他为什么这么做,他说感觉程序中定义了好多变量,怕GC回收不及时,用GC.Collect()可以手动掌控GC进行垃 ...

  4. 线程池读取List<T>实例

    private static readonly Object ThisLock = new object(); private static readonly AutoResetEvent AutoR ...

  5. [python] virtualenv下解决matplotlib中文乱码

    1. 安装中文字体 一般系统自带wqy-microhei,其ttc文件位于/usr/share/fonts/truetype/wqy/wqy-microhei.ttc 2. 将ttc文件复制到pyth ...

  6. sort对象数组排序

    function objectSort(property, desc) { //降序排列 if (desc) { return function (a, b) { return (a[property ...

  7. php PHP_EOL 常量

    换行符 unix系列用 \n windows系列用 \r\n mac用 \r PHP中可以用PHP_EOL来替代,以提高代码的源代码级可移植性 <?php echo PHP_EOL; //win ...

  8. Windows7 下安装 CentOS6.5

    内容来自:http://blog.163.com/for_log/blog/static/2162830282013031031278/第一部分:安装前准备1. 准备两个fat32格式的分区,一个用于 ...

  9. jquery完善的处理机制

    使用jQuery选择器不仅比使用传统的getElementById()和getElementsByTagName()函数简洁得多,而且还能避免某些错误.请看下面例子: <script> d ...

  10. php单引号和双引号的区别与用法

    php里的单引号把内容当成纯文本,不会经过服务器翻译.而双引号则与此相反.里面的内容会经过服务器处理(process). 举个简单的例子:   $foo="data"; echo ...