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. spark第二篇:Application Submission Guide

    提交应用 Spark的bin目录中的spark-submit脚本用于启动集群上的应用程序.它可以通过一个统一的接口使用所有Spark支持的集群管理器. 绑定应用程序的依赖 如果你的代码依赖其他项目,你 ...

  2. Jquery EasyUI Treegrid按需加载子集

    项目说明,要一个有权限并且按需加载的树形列表. jeasyui网址 CSS <!--添加树状控件--> <link rel="stylesheet" type=& ...

  3. unity监听键盘按键

    放在Update里面 if (Input.anyKeyDown) { foreach (KeyCode keyCode in Enum.GetValues(typeof(KeyCode))) { if ...

  4. 触发Full GC的时机

    由于Full GC的耗时是Minor GC的十倍左右,所以Full GC的频率设计得比Minor GC低得多.现总结一下触发Full GC的情况. 在那些实现了CMS的比较新的虚拟机中,如果配置了-X ...

  5. [html/js]点击标题出现下拉列表

    效果 初始 点击后 参考代码 <!DOCTYPE html> <html> <head> <title>Layer group example</ ...

  6. nyoj 10——skiing————————【记忆化搜索】

    skiing 时间限制:3000 ms  |  内存限制:65535 KB 难度:5   描述 Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激.可是为了获得速度,滑的区域必须向下倾斜,而且当 ...

  7. gcc链接非标准(non-standard)命名库

    标准命名库: -lnamespace 标准链接库以lib开头, 并以so/a结尾. example gcc test.c -o test -L. -lhello 非标准命名库: -l:libname ...

  8. 【linux相识相知】VIM编辑器

    Vim是一个类似Vi的著名的功能强大.高度可定制的文本编辑器,在Vi的基础上改进和增加了许多的功能,VIM是自由软件,今天我们就来讲讲VIM的使用方法. 本文是基于centos7上的vim编辑器演示的 ...

  9. 从零开始写C# MVC框架之--- 项目结构

    框架总分2个项目:Web开发项目.帮助类项目 (ZyCommon.Zy.Utilities) 1.ZyCommon,是Web开发项目结构.新建一个空解决方案,再建Data.Service.ZyWeb解 ...

  10. 用DebuggerDisplay在Visual Studio的调试器中定制类的显示方式

    博客搬到了fresky.github.io - Dawei XU,请各位看官挪步.最新的一篇是:用DebuggerDisplay在Visual Studio的调试器中定制类的显示方式.