运行环境

系统版本:无

软件版本:无

硬件要求:无

安装过程

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. 娱乐往事,年初捡到1G PAR,平淡的日子泛起波澜

    常听说这样的故事 垃圾佬捡到蓝牙键盘,于是配了一台上万的电脑 垃圾佬捡到机箱,于是配了一台带遥控的HTPC 垃圾佬捡到假NAS,于是组了20+T的RAID 而我,不是垃圾佬,更没有捡到过U盘,对突如其 ...

  2. QT5如何设置QLabel中字体的颜色

    修改了wd的文章: 如何使用Qt5,设置QLabel中字体的颜色. 大致有几种做法: 一是使用setPalette()方法: 二是使用样式表: 三是可以使用QStyle: 四是可以在其中使用一些简单的 ...

  3. This function or variable may be unsafe

    1>------ Build started: Project: wintest, Configuration: Debug Win32 ------ 1>  Source.cpp 1&g ...

  4. 如何为wordpress 的文章添加分页

    原文参考:http://www.wpdaxue.com/add-next-page-button-wordpress-post-editor.html 1.在编辑文章时切到text 模式,然后加上&l ...

  5. YUM源部署和使用

    1.前言 为什么需要内部yum源呢,有可能是业务内部的服务器对外是不通了,居于一些安全方面的考虑.内部yum源又有什么好处呢,第一,速度快:第二,内网可控,外网有问题也不影响内网包的下载和安装等. 2 ...

  6. [RAC] 1. 安装Oracle RAC时,不能验证ASMSNMP密码问题的解决(ORA-01031或ORA-01017)

      1."ORA-01031: insufficient privileges" [grid@node1 bin]$ orapwd file=/u01/app/11.2.0/gri ...

  7. Go语言实现:【剑指offer】最小的K个数

    该题目来源于牛客网<剑指offer>专题. 输入n个整数,找出其中最小的K个数.例如输入4,5,1,6,2,7,3,8这8个数字,则最小的4个数字是1,2,3,4,. Go语言实现: fu ...

  8. GDAL利用地理坐标读取图像像元值

    最近的一个项目需要在电子海图中下载已知水深点,导出点的地理坐标(经纬度).然后在arcgis中打开这些地理坐标输出为shp,利用GDAL读取不同波段的点对应的像元值,从而构建水深和像元值的对应关系. ...

  9. frp内网穿透协助内网程序(如微信相关)开发

    众所周知,在本机上开发微信相关的程序,很不方便,因为拨号IP随机,而且很多端口不支持,如80,443 所以,有必要使用一台外网主机中转. frp就可以解决此问题 安装环境,外网服务器:腾讯云,cent ...

  10. Keras学习系列——神经网络层组件

    对Keras提供的对各种层的抽象进行相对全面的概括 1 基础常用层 名称 作用 原型参数 Dense 实现全连接层 Dense(units,activation,use_bias=True, kern ...