zoukankan      html  css  js  c++  java
  • 安装Nginx到Linux(源码)

    运行环境

    系统版本:无
    软件版本:无
    硬件要求:无

    安装过程

    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
    
    乐在分享!~~
  • 相关阅读:
    非线性方程(组):高维方程解法
    非线性方程(组):一维非线性方程(二)插值迭代方法 [MATLAB]
    非线性方程(组):一维非线性方程(一)二分法、不动点迭代、牛顿法 [MATLAB]
    非线性方程(组):计算基本理论
    常微分方程初值问题:多步预测-修正方法 [MATLAB]
    你会使用super()吗?你确定你了解它吗?
    Django简介
    Web框架的原理
    Django ORM 中的批量操作
    Python的切片
  • 原文地址:https://www.cnblogs.com/network-ren/p/12377764.html
Copyright © 2011-2022 走看看