zoukankan      html  css  js  c++  java
  • Linux安装Nginx

    1 下载源码包

    Nginx官方网站:http://nginx.org/en/download.html

    1.1 找到稳定版连接地址

    1.2 下载解压

    下载:
    [root@localhost nginx-1.14.2]# wget http://nginx.org/download/nginx-1.14.2.tar.gz
    解压:
    [root@localhost nginx-1.14.2]# tar -zxvf nginx-1.14.2.tar.gz
    

    1.3 目录结构

    2 配置 编译 安装

    查看可配置参数:./configure --help,这里只指定安装目录:

    配置:
    [root@localhost nginx-1.14.2]# ./configure --prefix=/usr/local/lib64/nginx
    编译:
    [root@localhost nginx-1.14.2]# make
    安装:
    [root@localhost nginx-1.14.2]# make install
    建立链接:
    [root@localhost usr]# ln -s /usr/local/lib64/nginx/sbin/nginx /usr/local/sbin/
    

    可能会遇到the HTTP rewrite module requires the PCRE library 的情况
    执行yum -y install pcre-devel openssl openssl-devel即可。

    测试一下:nginx -h

    3 总结

    下载:
    [root@localhost nginx-1.14.2]# wget http://nginx.org/download/nginx-1.14.2.tar.gz
    解压:
    [root@localhost nginx-1.14.2]# tar -zxvf nginx-1.14.2.tar.gz
    配置:
    [root@localhost nginx-1.14.2]# ./configure --prefix=/usr/local/lib64/nginx
    编译:
    [root@localhost nginx-1.14.2]# make
    安装:
    [root@localhost nginx-1.14.2]# make install
    建立链接:
    [root@localhost usr]# ln -s /usr/local/lib64/nginx/sbin/nginx /usr/local/sbin/
    测试:
    [root@localhost ~]# nginx -h
    
  • 相关阅读:
    docker入门(一)
    netstat命令
    grep的小技巧
    gd库的安装
    jar命令的用法详解
    关于awk的范围模式功能问题
    更换文本中第二次出现的字符串内容
    awk打印第n个参数到最后一个技巧/将n行组成一列
    awk -f program.file 功能使用
    shell的变量处理
  • 原文地址:https://www.cnblogs.com/NameZZH/p/10721450.html
Copyright © 2011-2022 走看看