zoukankan      html  css  js  c++  java
  • nginx 的源码安装

    安装nginx之前要做的准备工作有:安装如下库

    (1)gzip模块需要 zlib 库

    (2)rewrite模块需要 pcre 库

    (3)ssl 功能需要openssl库

    还有一种简单的方法就是

    yum install gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl openssl-devel

    然后就是解压压缩包,编译安装就行了

    1~pcre的安装:

    我们可以之间yum 安装

    yum -y install pcre*

    或者源码安装

    cd /usr/local/src

    wget https://sourceforge.net/projects/pcre/files/pcre/8.39/pcre-8.39.tar.gz/download

    tar xf  pcre-8.39.tar.gz

    cd pcre-8.39

    ./configure

    make

    make install

    2~openssl的安装

    需要ssl的支持,如果不需要,跳过这一步,

    yum   安装

    yum -y install openssl*

    源码安装

    wget   ftp://ftp.openssl.org/source/openssl-1.0.1t.tar.gz

    tar xf

    cd

    ./config

    make && make install

    在安装这个的时候指定一下安装路径因为在下面安装nginx的时候需要指定openssl的安装路径

    3.zlib的编译安装:

    wget  http://zlib.net/zlib-1.2.8.tar.gz

    tar  xf

    cd

    ./configure

    make && make install

    4~重头戏来了,nginx的编译安装

    wget   http://nginx.org/download/nginx-1.10.1.tar.gz

    groupadd nginx

    useradd nginx -g nginx

    tar xf nginx-1.10.1.tar.gz

    ./configure --prefix=/usr/local/nginx  --user=nginx   --group=nginx --with-http_ssl_module   --with-http_stub_status_module --with-pcre  -with-openssl=/usr/local/src/openssl-1.0.1t

    下面解释一下

    --with-pcre:为了支持rewrite重写功能,必须制定pcre

    --with-http_stub_status_module:支持nginx状态查询

    --with-http_ssl_module:支持https

    最后执行:make   && make install

    至此nginx  就安装完成了

    nginx的启动方式为

    cd /usr/local/nginx/sbin/

    ./nginx -s start |  stop     |       restart    |     reload

  • 相关阅读:
    php查找字符串中的http地址,并转换
    mojoPortalprovider模式学习之1.1 IndexBuilderConfiguration
    mojoportal学习笔记之一
    写博客了
    mojoPortal学习笔记之IndexBuilderProvider
    mojoportal学习笔记之IIndexableContent接口
    mojoportal学习笔记之How to Write a Provider Model
    flash图片新闻(源码)
    GridView控件日期格式化
    改变自己,学会调整自己,保持美好工作心情!
  • 原文地址:https://www.cnblogs.com/smail-bao/p/5623286.html
Copyright © 2011-2022 走看看