1、安装nginx依赖的库pcre
      下载地址:http://sourceforge.net/projects/pcre/
   
2、解压pcre 
      zip解压方式:unzip pcre-xxx
      tar解压方式:tar -xzvf pcre-xxx
   
3、执行configure
      cd  prce-xxx
      ./configure 
      假设执行出错:You need a C++ compiler for C++ support
      则须要安装C++编译环境:yum install -y gcc gcc-c++
   
4、安装和编译prce
      make && make install 
 
 
5、解压nginx
      tar -xzvf nginx-xxx
   
6、执行configure
      cd  nginx-xxx
      ./configure 
     假设执行出错:./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.
   则须要安装zlib库:yum install zlib-devel
   
7、安装nginx
      make && make install

   
8、启动nginx
      /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
      启动出错:/usr/local/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
    
   解决的方法:ldd /usr/local/nginx/sbin/nginx    =====>查看链接库是否正常
   
    linux-vdso.so.1 =>  (0x00007fff1e3ff000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003ea5800000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x0000003eb0400000)
libpcre.so.1 => not found
libz.so.1 => /lib64/libz.so.1 (0x0000003ea6800000)
libc.so.6 => /lib64/libc.so.6 (0x0000003ea5000000)
/lib64/ld-linux-x86-64.so.2 (0x0000003ea4c00000)
libfreebl3.so => /lib64/libfreebl3.so (0x0000003eb1000000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003ea5400000)

9、ln -s libpcre.so.0.0.1 libpcre.so.1

10、再次启动nginx 
        ./usr/local/nginx/sbin/nginx

11、ps -ef | grep nginx

       查看nginx是否启动成功

2. 安装Pcre
  • wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
  • tar -xzvf pcre-8.41.tar.gz
  • cd pcre-8.41
  • ./configure
  • make && make install
3. 安装openssl
4. 安装zlib
5.安装ngxin
错误解决方式:
1. You need a C++ compiler for C++ support.
yum install -y gcc gcc-c++

Centos6.5(Linux)安装Nginx的更多相关文章

  1. linux安装Nginx 以及 keepalived 管理Nginx

    linux安装Nginx 1.1将Nginx素材内容上传到/usr/local目录(pcre,zlib,openssl,nginx)(注意:必须登录用对这个文件具有操作权限的) 1.2安装pcre库 ...

  2. linux学习(十一)linux安装nginx

    一.前言 由于本地练手的小demo用的是vue+spring boot来玩的,所以部署的时候想着用Nginx来实现反向代理[即请求转发,解决前后端分离的跨域请求问题],既然要用,那么首先得在服务器上面 ...

  3. linux安装nginx 并配置文件服务器和代理服务器

    linux安装nginx搭建服务并实现文件服务器和代理服务器配置 1.课题的背景和意义 由于编码过程中需要进行文件上传服务,文件上传后 需要有http资源的路径需要访问.原则上可以通过Apache . ...

  4. linux 安装nginx

    linux系统为Centos6.5 64位 nginx为1.4.7 从http://nginx.org/download/上下载相应的版本 解压 tar -zxvf nginx-1.4.7.tar.g ...

  5. linux 安装nginx 详解

    1 nginx安装环境 nginx是C语言开发,建议在linux上运行,本教程使用Centos6.5作为安装环境. n gcc 安装nginx需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没 ...

  6. Linux 安装Nginx具体图解教程

    系统:Centos6.6  64位 Nginx:  http://nginx.org/en/download.html 眼下最新版本号1.9.4 我下载1.8.0 watermark/2/text/a ...

  7. Linux安装nginx的环境要求

    # Linux下切记不能乱删东西!我把pcre强制删除后,什么命令都不能使用了,系统奔溃,血的教训! nginx是C语言开发,建议在linux上运行,本教程使用Centos6.4作为安装环境. 一.  ...

  8. linux安装nginx步骤

    转载自:https://blog.csdn.net/t8116189520/article/details/81909574,修改部分内容 本文已收录至博客专栏linux安装各种软件及配置环境教程中 ...

  9. linux 安装 nginx 及反向代理配置

    Nginx ("engine x") 是一个高性能的HTTP和反向代理服务器,以下为Linux centos平台下安装nginx并配置反向代理的过程(采用源码安装的方式) 一:安装 ...

随机推荐

  1. python小商店

    (1) 输入自己所有的钱.(2) 展示商品的序号,名称及其价格.(3) 输入要买商品的序号.(4) 输入要买商品的数量.(5) 购物车中显示购买的水果名称及其对应的数量和剩余钱.(6) 如果序号输入有 ...

  2. Vim as a Python IDE

    参考视频:http://v.youku.com/v_show/id_XNDY4NTM4NzY0.html 好的,在我们默认的centos6的操作系统中使用的python2,我们一般会再去安装一个pyt ...

  3. 如何将项目部署到远程的Linux机器上的tomcat上

    下面来练习一下如何将本地的一个项目部署到远程的Linux机器上去. 第一步:将要部署到Linux机器上的项目打成一个war包 war包有一个好处tomcat可以自动解压 第二步:将打好的war上传到L ...

  4. js判断触摸方向

    $("body").on("touchstart", function(e) { e.preventDefault(); startX = e.original ...

  5. MyEclipse 中tomcat 调试时进入未打断点的代码

    在preferences里面取消挂起未捕获异常

  6. WinSock 重叠IO模型

    title: WinSock 重叠IO模型 tags: [WinSock 模型, 网络编程, 重叠IO模型] date: 2018-06-29 20:26:13 categories: Windows ...

  7. js添加、修改、删除xml节点例子

    version="1.0" encoding="gb2312"?> . <bookstore> . <book genre=" ...

  8. Java入门到精通——调错篇之Spring2.5使用AOP时报错only available on JDK 1.5 and higher

    一.问题描述及原因. 在Spring2.5Aop例子中的时候会出现一个错误only available on JDK 1.5 and higher,大概意思就是需要JDK1.5甚至更高版本.但是我用的 ...

  9. C++基础--结构体声名

    struct是一种数据结构,当需要存储的相关数据为一个集合时,struct是很好的选择;例如,当存储student,学生的学号, 名字,年龄,身高,就构成了一个集合,用stuct声名为: typede ...

  10. android startActivityForResult()

    举例说我想要做的一个事情是,在一个主界面(主Activity)上能连接往许多不同子功能模块(子Activity上去),当子模块的事情做完之后就回到主界面,或许还同时返回一些子模块完成的数据交给主Act ...