安装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

nginx 的源码安装的更多相关文章

  1. Nginx unit 源码安装初体验

    Nginx unit 源码安装初体验 上次介绍了从yum的安装方法(https://www.cnblogs.com/wang-li/p/9684040.html),这次将介绍源码安装,目前最新版为1. ...

  2. 编译nginx的源码安装subs_filter模块

    使用nginx的反向代理功能搭建nuget镜像服务器时,需要针对官方nuget服务器的响应内容进行字符串替换,比如将www.nuget.org替换为镜像服务器的主机名,将https://替换为http ...

  3. NFS, web,负载均衡,Nginx yum 源码安装

    作业一:nginx服务1.二进制安装nginx 2.作为web服务修改配置文件 3.让配置生效,验证配置  [root@localhost ~]# systemctl stop firewalld.s ...

  4. linux应用之nginx的源码安装及配置(centos)

    1.准备工作选首先安装这几个软件:GCC,PCRE(Perl Compatible Regular Expression),zlib,OpenSSL.Nginx是C写的,需要用GCC编译:Nginx的 ...

  5. 关于nginx的源码安装方式

    Nginx(engine x)是一款是由俄罗斯的程序设计师Igor Sysoev所开发高性能的 Web和 反向代理 服务器, 也是一个 IMAP/POP3/SMTP 代理服务器.在高连接并发的情况下, ...

  6. zabbix,php,nginx,mysql源码安装 神仙操作

    →软件包 mkdir /soft/ cd /soft ♦下载以下软件包 nginx-1.14.2.tar.gz wget http://nginx.org/download/nginx-1.14.2. ...

  7. linux nginx+php源码安装

    PHP安装 1)下载 wget http://cn2.php.net/distributions/php-5.6.30.tar.gz 2)解压 tar –xf php-5.6.30 3)进入目录 cd ...

  8. 源码安装nginx以及平滑升级

                                                           源码安装nginx以及平滑升级                               ...

  9. Nginx源码安装及调优配置

    导读 由于Nginx本身的一些优点,轻量,开源,易用,越来越多的公司使用nginx作为自己公司的web应用服务器,本文详细介绍nginx源码安装的同时并对nginx进行优化配置. Nginx编译前的优 ...

随机推荐

  1. uva 120 stacks of flapjacks ——yhx

     Stacks of Flapjacks  Background Stacks and Queues are often considered the bread and butter of data ...

  2. 边工作边刷题:70天一遍leetcode: day 81

    Encode and Decode Strings 要点:题的特点:不是压缩,而是encode为字节流.所以需要找delimiter来分割每个word,但是delimiter可能是字符本身,所以可以用 ...

  3. UVA 12380 Glimmr in Distress --DFS

    题意:给你一串数字序列,只包含0,1,2,一路扫描过去,遇到2则新开一个2x2的矩阵,然后如果扫到0或1就将其填入矩阵,注意不能四个方格全是0或者全是1,那样跟一个方格没区别,所以21111这种是不可 ...

  4. js中容易被忽视的事件问题总结

    一:跨平台事件 什么叫跨平台事件?即在不同的浏览器上执行同一事件,所使用的方法不同. 什么是EventUtil对象?有什么作用?即将所有与事件相关的函数,融合在一起的一个容器,方便管理事件对象,它没有 ...

  5. 打包Android:Error building Player: CommandInvokationFailure

    错误log Error building Player: CommandInvokationFailure: Unable to determine the tools version of the ...

  6. for循环的三种写法

    第一种写法  传统的方法,遍历数组 String[] arr = { "amy", "heinrich", "cindy", "g ...

  7. 11Spring_AOP编程(AspectJ)_概述

    AspectJ 是一个框架 (第三方AOP框架 ),提供切面编程 ,编写一个Aspect 支持多个Advice和多个PointCut .对比前一种提到的传统的Aop编程,AspctJ更加的常用.Asp ...

  8. Linux查看系统资源命令

    转载于:http://lxbins.blog.51cto.com/1089997/283663 top:======================================主要参数d:指定更新 ...

  9. Java集合---HashSet的源码分析

    一.  HashSet概述: HashSet实现Set接口,由哈希表(实际上是一个HashMap实例)支持.它不保证set 的迭代顺序:特别是它不保证该顺序恒久不变.此类允许使用null元素. 二.  ...

  10. 从0开始学java——JUnit4 复习,其实基本思想还是那些,不过采用了新的注释格式的语法

    看了深入探索 JUnit 4(http://www.ibm.com/developerworks/cn/education/java/j-junit4/index.html  ) 主要是讲了新的基于注 ...