运行环境

系统版本:无

软件版本:无

硬件要求:无

安装过程

NGINX官方提供源码包的下载,NGINX有两个版本Mainline(主线)版和Stable(稳定)版。主线版本我们可以理解为是开发版本,在生产环境中建议使用稳定版本。

源码安装适用于所有Linux操作系统。

NGINX官方下载地址:http://nginx.org/en/download.html。

1、下载软件包

[root@localhost ~]# wget http://nginx.org/download/nginx-1.14.0.tar.gz

2、解压软件包

[root@localhost ~]# tar xzvf nginx-1.14.0.tar.gz
[root@localhost ~]# ls
nginx-1.14.0 nginx-1.14.0.tar.gz

3、安装相关依赖

[root@localhost ~]# yum -y install gcc gcc-c++ autoconf automake pcre pcre-devel zlib zlib-devel openssl openssl-devel gd-devel

4、配置、编译并安装

[root@localhost ~]# cd nginx-1.14.0
[root@localhost nginx-1.14.0]# ./configure --prefix=/usr/local/nginx/ --with-threads --with-file-aio --with-http_ssl_module --with-http_realip_module --with-http_image_filter_module=dynamic --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_slice_module --with-http_stub_status_module --with-stream=dynamic --with-compat
[root@localhost nginx-1.14.0]# make -j4 && make install

5、配置环境变量

配置环境变量,使Nginx命令在全局使用。

[root@localhost sbin]# vim /etc/profile
export NGINX_PATH=/usr/local/nginx/sbin
export PATH=$PATH:$NGINX_PATH
[root@localhost sbin]# source /etc/profile

6、查看NGINX的版本及编译选项

[root@localhost conf]# nginx -V
nginx version: nginx/1.14.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx/ --with-threads --with-file-aio --with-http_ssl_module --with-http_realip_module --with-http_image_filter_module=dynamic --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_slice_module --with-http_stub_status_module --with-stream=dynamic --with-compat

安装Nginx到Linux(源码)的更多相关文章

  1. 1.linux源码安装nginx

    从官网下载nginx.tar.gz源码包 拷贝至Linux系统下进行解压 tar -zxvf nginx.tar.gz 进入解压后的目录,需要./configure,此步骤会报多个错,比如没有安装gc ...

  2. Linux源码安装RabbitMQ高可用集群

    1.环境说明 linux版本:CentOS Linux release 7.9.2009 erlang版本:erlang-24.0 rabbitmq版本:rabbitmq_server-3.9.13 ...

  3. Linux源码安装JDK1.8

    Linux源码安装Java 1.到官网下载 jdk-8u131-linux-x64.tar.gz 官网地址:http://www.oracle.com/technetwork/java/javase/ ...

  4. Debian 安装Linux源码

    参考: http://blog.chinaunix.net/uid-20683355-id-1895778.html http://www.linuxdiyf.com/viewarticle.php? ...

  5. Nginx 最新版源码编译安装 包含常用模块作用及所需依赖

    第一部分 Nginx最新版源码编译安装 1. 使用的模块 模块1:http_rewrite_module 基于正则匹配来实现重定向.依赖PCRE库,见依赖1 模块2:http_gzip_module ...

  6. mysql-5.5 for linux源码安装

    mysql-5.5 for linux源码安装 1.使用Yum安装依赖软件包 # yum install -y gcc gcc-c++ gcc-g77 autoconf automake bison  ...

  7. 转载 :Linux有问必答:如何在Debian或Ubuntu上安装完整的内核源码

    http://linux.cn/article-5015-1.html 问题:我需要为我的Debian或Ubuntu下载并安装完整树结构的内核源码以供编译一个定制的内核.那么在Debian或Ubunt ...

  8. linux源码安装mysql,shell编程学习,ubuntu

    一.mysql安装 以源码安装的方式编译和安装Mysql 5.6. 1.卸载旧版本 rpm -qa | grep mysql 检查是否有旧版本 查询结果:mysql-libs-5.1.73-7.el6 ...

  9. 『学了就忘』Linux软件包管理 — 47、Linux源码包的安装和卸载

    目录 1.源码包安装服务的注意事项 2.源码包安装服务的过程 3.源码包安装服务的删除 4.源码包安装服务的启动 5.源码包安装服务的关闭 1.源码包安装服务的注意事项 (1)安装服务选择哪种软件包? ...

随机推荐

  1. python之路:day2

    本节内容 列表.元组操作 字符串操作 字典操作 集合操作 文件操作 字符编码与转码 1. 列表.元组操作 列表是我们最以后最常用的数据类型之一,通过列表可以对数据实现最方便的存储.修改等操作 定义列表 ...

  2. C语言之灵魂 指针学习

    指针是c语言的难点 称之为c语言的灵魂一点也不为过,不过指针用好了能事半功倍,用不好bug满天飞. 一.指针的概念 指针也是变量只不过是特殊的变量,指针的值是另一个变量的地(也就是变量所在的内存地址) ...

  3. java数据域初始化

    1.在声明中赋值 /** * Created by N3verL4nd on 2016/11/19. */ class Test{ private String str = "Hello W ...

  4. VC运行时库/MD、/MDd、/MT、/MTd说明

    http://blog.csdn.net/holybin/article/details/26134153 VC运行时库设置:VC项目属性->配置属性->C/C++->代码生成-&g ...

  5. jsp连接mysql案例

    下载mysql-connector-java-5.1.26 将mysql-connector-java-5.1.26-bin.jar放在\jdk\jre\lib\ext中 -------------- ...

  6. Java 接口及接口回调_Chris

    题目: 利用接口和接口回调,实现简单工厂模式,当输入不同的字符,代表相应图形时,利用工厂类获得图形对象,再计算以该图形为底的柱体体积. 代码: 1.Test.java /** * 测试类,包含一个主方 ...

  7. Imagine— 让图片再小一点点

    文章选自我的博客:https://blog.ljyngup.com/archives/267.html/ 再次祭出神奇的Github 这次给大家介绍的是一款神奇的图片压缩软件,以质量的微小损失换取大量 ...

  8. Spark作业执行流程源码解析

    目录 相关概念 概述 源码解析 作业提交 划分&提交调度阶段 提交任务 执行任务 结果处理 Reference 本文梳理一下Spark作业执行的流程. Spark作业和任务调度系统是其核心,通 ...

  9. hexo--定制开发

    新建页面 hexo new page "新建博文章的名称" 这时会在工程的source目录下新建about目录,里面新建index.md 在主题的_configy.yml中配置新页 ...

  10. 6.【Spring Cloud Alibaba】API网关-SpringCloudGateway

    SpringCloud Gateway是什么?优缺点分析 springCloud Gateway优点 springCloud Gateway缺点 编写SpringCloundGateway pom.x ...