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
    
    乐在分享!~~
  • 相关阅读:
    JavaScript-5(数组)
    JavaScript-作用域-预解析
    JavaScript-日历生成器
    JavaScript-8行5列表格
    package XXX.i386.rpm is not installed(检查在Linux上安装Oracle所需的pkg时)
    ubuntu13.04下安装jdk7
    Linux远程传输命令之scp使用方法
    Mac OS X中MacPorts安装和使用
    第一天 Linux 是什么
    Javascript与当前项目的思考
  • 原文地址:https://www.cnblogs.com/network-ren/p/12377764.html
Copyright © 2011-2022 走看看