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. 2.5 References & Borrowing

    Here is how you would define and use a calculate_length function that has a reference to an object a ...

  2. 关于箭头函数的this指向问题

    document.onclick = function(){ // 普通函数的this是在运行的时候才临时绑定的,也就是说,函数不运行,你绝对不可能知道this是谁 // 下面这个函数如果是自调用,t ...

  3. SQL Server 2008 SQL2012 SQL2014 收缩日志 清空删除大日志文件

    SQL2008 SQL2012 SQL2014 的收缩日志 由于SQL2008对文件和日志管理进行了优化,所以以下语句在SQL2005中可以运行但在SQL2008中已经被取消:(SQL2005)Bac ...

  4. win7与ubuntu双系统安装

    机器型号:联想V470 对系统引导一直不是很明白,导致我出现几次失败. 一直挺喜欢ubuntu的,因为,第一我感觉它比较友好,第二我初次接触linux就是ubuntu,当初还是同学帮助我wubi进行安 ...

  5. TOJ 3486 Divisibility

    Description On the planet Zoop, numbers are represented in base 62, using the digits 0, 1, . . . , 9 ...

  6. nyoj 999——师傅又被妖怪抓走了——————【双广搜】

    师傅又被妖怪抓走了 时间限制:1000 ms  |  内存限制:65535 KB 难度:3   描述 话说唐僧复得了孙行者,师徒们一心同体,共诣西方.自宝象国救了公主,承君臣送出城西,沿路饥餐渴饮,悟 ...

  7. AtCoder Grand Contest 023 C - Painting Machines

    Description 一个长度为 \(n\) 的序列,初始都为 \(0\),你需要求出一个长度为 \(n-1\) 的排列 \(P\), 按照 \(1\) 到 \(n\) 的顺序,每次把 \(P_i\ ...

  8. 关于Javascript模块化和命名空间管理的问题说明

    最近闲下来的时候,稍微想了想这个问题.关于Javascript模块化和命名空间管理 [关于模块化以及为什么要模块化] 先说说我们为什么要模块化吧.其实这还是和编码思想和代码管理的便利度相关(没有提及名 ...

  9. ubuntu 下查找某个文件的方法

    1.whereis 文件名 特点:快速,但是是模糊查找,例如 找 #whereis mysql 它会把mysql,mysql.ini,mysql.*所在的目录都找出来. 2.find / -name  ...

  10. 引爆你的Javascript代码进化 (转)

    转自 海玉的博客 方才在程序里看到一段JS代码,写法极为高明,私心想着若是其按照规范来写,定可培养对这门语言的理解,对JS编程能力提高必是极好的.说人话:丫代码写的太乱,看的窝火! 最近闲暇无事,准备 ...