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
    
  • 相关阅读:
    Eclipse在线集成maven M2eclipse插件
    RBAC用户权限管理数据库设计
    Linux下修改mysql密码
    Red hat 6.4下面的qt安装
    export default {} 和new Vue()区别
    Ajax中POST和GET的区别
    JS es6-Symbol
    JS es6编程规范
    JS之箭头函数
    JS异步加载的方式
  • 原文地址:https://www.cnblogs.com/NameZZH/p/10721450.html
Copyright © 2011-2022 走看看