zoukankan      html  css  js  c++  java
  • 【CentOS_7】安装nginx

    1,下载

    [root@VM_0_7_centos local]# wget http://nginx.org/download/nginx-1.14.2.tar.gz
    --2018-12-13 11:14:18--  http://nginx.org/download/nginx-1.14.2.tar.gz
    Resolving nginx.org (nginx.org)... 95.211.80.227, 206.251.255.63, 2606:7100:1:69::3f, ...
    Connecting to nginx.org (nginx.org)|95.211.80.227|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 1015384 (992K) [application/octet-stream]
    Saving to: ‘nginx-1.14.2.tar.gz’
    
    100%[=================================================================================================>] 1,015,384    584KB/s   in 1.7s   
    
    2018-12-13 11:14:20 (584 KB/s) - ‘nginx-1.14.2.tar.gz’ saved [1015384/1015384]

    2,解压

    [root@VM_0_7_centos local]# tar -zxvf nginx-1.14.2.tar.gz 

    3,设置

    [root@VM_0_7_centos local]# cd nginx-1.14.2/
    [root@VM_0_7_centos nginx-1.14.2]# ll
    total 752
    drwxr-xr-x 6 1001 1001   4096 Dec 13 11:14 auto
    -rw-r--r-- 1 1001 1001 288742 Dec  4 22:52 CHANGES
    -rw-r--r-- 1 1001 1001 440121 Dec  4 22:52 CHANGES.ru
    drwxr-xr-x 2 1001 1001   4096 Dec 13 11:14 conf
    -rwxr-xr-x 1 1001 1001   2502 Dec  4 22:52 configure
    drwxr-xr-x 4 1001 1001   4096 Dec 13 11:14 contrib
    drwxr-xr-x 2 1001 1001   4096 Dec 13 11:14 html
    -rw-r--r-- 1 1001 1001   1397 Dec  4 22:52 LICENSE
    drwxr-xr-x 2 1001 1001   4096 Dec 13 11:14 man
    -rw-r--r-- 1 1001 1001     49 Dec  4 22:52 README
    drwxr-xr-x 9 1001 1001   4096 Dec 13 11:14 src
    [root@VM_0_7_centos nginx-1.14.2]# pwd
    /usr/local/nginx-1.14.2
    [root@VM_0_7_centos nginx-1.14.2]# cd ..
    [root@VM_0_7_centos local]# ll
    total 1048
    drwxr-xr-x.  2 root root    4096 Dec 11 15:38 bin
    drwxr-xr-x.  2 root root    4096 Apr 11  2018 etc
    drwxr-xr-x.  2 root root    4096 Apr 11  2018 games
    drwxr-xr-x   6 root root    4096 Dec 10 11:44 git
    drwxr-xr-x.  3 root root    4096 Dec 10 11:08 include
    drwxr-xr-x.  4 root root    4096 Dec 10 11:08 lib
    drwxr-xr-x.  2 root root    4096 Apr 11  2018 lib64
    drwxr-xr-x.  2 root root    4096 Apr 11  2018 libexec
    drwxr-xr-x   8 1001 1001    4096 Dec  4 22:52 nginx-1.14.2
    -rw-r--r--   1 root root 1015384 Dec  4 22:57 nginx-1.14.2.tar.gz
    drwxr-xr-x   3 root root    4096 Dec 10 11:05 python3
    drwxr-xr-x  10 root root    4096 Oct 10 11:26 qcloud
    drwxr-xr-x.  2 root root    4096 Apr 11  2018 sbin
    drwxr-xr-x.  5 root root    4096 Aug  8 11:09 share
    drwxr-xr-x.  3 root root    4096 Dec 10 11:42 src
    srwxrwxrwx   1 root root       0 Oct 10 11:27 yd.socket.client
    [root@VM_0_7_centos local]# mkdir nginx -p
    [root@VM_0_7_centos local]# cd nginx-1.14.2/
    [root@VM_0_7_centos nginx-1.14.2]# ll
    total 752
    drwxr-xr-x 6 1001 1001   4096 Dec 13 11:14 auto
    -rw-r--r-- 1 1001 1001 288742 Dec  4 22:52 CHANGES
    -rw-r--r-- 1 1001 1001 440121 Dec  4 22:52 CHANGES.ru
    drwxr-xr-x 2 1001 1001   4096 Dec 13 11:14 conf
    -rwxr-xr-x 1 1001 1001   2502 Dec  4 22:52 configure
    drwxr-xr-x 4 1001 1001   4096 Dec 13 11:14 contrib
    drwxr-xr-x 2 1001 1001   4096 Dec 13 11:14 html
    -rw-r--r-- 1 1001 1001   1397 Dec  4 22:52 LICENSE
    drwxr-xr-x 2 1001 1001   4096 Dec 13 11:14 man
    -rw-r--r-- 1 1001 1001     49 Dec  4 22:52 README
    drwxr-xr-x 9 1001 1001   4096 Dec 13 11:14 src
    [root@VM_0_7_centos nginx-1.14.2]# ./configure --prefix=/usr/local/nginx

    4,编译安装

    [root@VM_0_7_centos nginx-1.14.2]# ll
    total 760
    drwxr-xr-x 6 1001 1001   4096 Dec 13 11:14 auto
    -rw-r--r-- 1 1001 1001 288742 Dec  4 22:52 CHANGES
    -rw-r--r-- 1 1001 1001 440121 Dec  4 22:52 CHANGES.ru
    drwxr-xr-x 2 1001 1001   4096 Dec 13 11:14 conf
    -rwxr-xr-x 1 1001 1001   2502 Dec  4 22:52 configure
    drwxr-xr-x 4 1001 1001   4096 Dec 13 11:14 contrib
    drwxr-xr-x 2 1001 1001   4096 Dec 13 11:14 html
    -rw-r--r-- 1 1001 1001   1397 Dec  4 22:52 LICENSE
    -rw-r--r-- 1 root root    376 Dec 13 11:17 Makefile
    drwxr-xr-x 2 1001 1001   4096 Dec 13 11:14 man
    drwxr-xr-x 3 root root   4096 Dec 13 11:17 objs
    -rw-r--r-- 1 1001 1001     49 Dec  4 22:52 README
    drwxr-xr-x 9 1001 1001   4096 Dec 13 11:14 src
    [root@VM_0_7_centos nginx-1.14.2]# make && make install

    5,检查安装是否完成

    [root@VM_0_7_centos nginx-1.14.2]# pwd
    /usr/local/nginx-1.14.2
    [root@VM_0_7_centos nginx-1.14.2]# cd ..
    [root@VM_0_7_centos local]# ll
    total 1052
    drwxr-xr-x.  2 root root    4096 Dec 11 15:38 bin
    drwxr-xr-x.  2 root root    4096 Apr 11  2018 etc
    drwxr-xr-x.  2 root root    4096 Apr 11  2018 games
    drwxr-xr-x   6 root root    4096 Dec 10 11:44 git
    drwxr-xr-x.  3 root root    4096 Dec 10 11:08 include
    drwxr-xr-x.  4 root root    4096 Dec 10 11:08 lib
    drwxr-xr-x.  2 root root    4096 Apr 11  2018 lib64
    drwxr-xr-x.  2 root root    4096 Apr 11  2018 libexec
    drwxr-xr-x   6 root root    4096 Dec 13 11:17 nginx
    drwxr-xr-x   9 1001 1001    4096 Dec 13 11:17 nginx-1.14.2
    -rw-r--r--   1 root root 1015384 Dec  4 22:57 nginx-1.14.2.tar.gz
    drwxr-xr-x   3 root root    4096 Dec 10 11:05 python3
    drwxr-xr-x  10 root root    4096 Oct 10 11:26 qcloud
    drwxr-xr-x.  2 root root    4096 Apr 11  2018 sbin
    drwxr-xr-x.  5 root root    4096 Aug  8 11:09 share
    drwxr-xr-x.  3 root root    4096 Dec 10 11:42 src
    srwxrwxrwx   1 root root       0 Oct 10 11:27 yd.socket.client
    [root@VM_0_7_centos local]# cd nginx
    [root@VM_0_7_centos nginx]# ll
    total 16
    drwxr-xr-x 2 root root 4096 Dec 13 11:17 conf
    drwxr-xr-x 2 root root 4096 Dec 13 11:17 html
    drwxr-xr-x 2 root root 4096 Dec 13 11:17 logs
    drwxr-xr-x 2 root root 4096 Dec 13 11:17 sbin
    [root@VM_0_7_centos nginx]#  
  • 相关阅读:
    Corlpack 0.5.1 发布,Ada 工具包
    HTML5状况及发展形势报告发布
    c++gtkutils 2.0.14 发布,轻量级的 C++ 类库
    Resin 4.0.34 发布,Java应用服务器
    IntelliJ IDEA 12.0.3 更新版发布
    StoryText 3.9 发布,图形界面测试工具
    UberStudent 2.0 "Lightweight" 发布
    中国移动集中化BI探索:数据仓库与Hadoop混搭
    MariaDB 10.0 和 MySQL 5.6 有何不同
    Java 转原生平台代码 RoboVM
  • 原文地址:https://www.cnblogs.com/BH8ANK/p/10112990.html
Copyright © 2011-2022 走看看