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
    
    乐在分享!~~
  • 相关阅读:
    C# DataGridview转换为DataTable
    未在本地计算机上注册“microsoft.ACE.oledb.12.0”提供程序
    ORM(Object Relational Mapping)框架
    C#开发小技巧
    Windows系统中Oracle11g R2 版本数据库卸载
    world特殊控制符输入
    Java中生成帮助文档
    Java类——JDBC链接、并操作MySQL数据库
    Java——实现对密码进行MD5加密
    HTTP协议详解
  • 原文地址:https://www.cnblogs.com/network-ren/p/12377764.html
Copyright © 2011-2022 走看看