博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【CentOS_7】安装nginx
阅读量:4934 次
发布时间:2019-06-11

本文共 5198 字,大约阅读时间需要 17 分钟。

 

 

 

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.gzResolving 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 OKLength: 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]# lltotal 752drwxr-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.rudrwxr-xr-x 2 1001 1001   4096 Dec 13 11:14 conf-rwxr-xr-x 1 1001 1001   2502 Dec  4 22:52 configuredrwxr-xr-x 4 1001 1001   4096 Dec 13 11:14 contribdrwxr-xr-x 2 1001 1001   4096 Dec 13 11:14 html-rw-r--r-- 1 1001 1001   1397 Dec  4 22:52 LICENSEdrwxr-xr-x 2 1001 1001   4096 Dec 13 11:14 man-rw-r--r-- 1 1001 1001     49 Dec  4 22:52 READMEdrwxr-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]# lltotal 1048drwxr-xr-x.  2 root root    4096 Dec 11 15:38 bindrwxr-xr-x.  2 root root    4096 Apr 11  2018 etcdrwxr-xr-x.  2 root root    4096 Apr 11  2018 gamesdrwxr-xr-x   6 root root    4096 Dec 10 11:44 gitdrwxr-xr-x.  3 root root    4096 Dec 10 11:08 includedrwxr-xr-x.  4 root root    4096 Dec 10 11:08 libdrwxr-xr-x.  2 root root    4096 Apr 11  2018 lib64drwxr-xr-x.  2 root root    4096 Apr 11  2018 libexecdrwxr-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.gzdrwxr-xr-x   3 root root    4096 Dec 10 11:05 python3drwxr-xr-x  10 root root    4096 Oct 10 11:26 qclouddrwxr-xr-x.  2 root root    4096 Apr 11  2018 sbindrwxr-xr-x.  5 root root    4096 Aug  8 11:09 sharedrwxr-xr-x.  3 root root    4096 Dec 10 11:42 srcsrwxrwxrwx   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]# lltotal 752drwxr-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.rudrwxr-xr-x 2 1001 1001   4096 Dec 13 11:14 conf-rwxr-xr-x 1 1001 1001   2502 Dec  4 22:52 configuredrwxr-xr-x 4 1001 1001   4096 Dec 13 11:14 contribdrwxr-xr-x 2 1001 1001   4096 Dec 13 11:14 html-rw-r--r-- 1 1001 1001   1397 Dec  4 22:52 LICENSEdrwxr-xr-x 2 1001 1001   4096 Dec 13 11:14 man-rw-r--r-- 1 1001 1001     49 Dec  4 22:52 READMEdrwxr-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]# lltotal 760drwxr-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.rudrwxr-xr-x 2 1001 1001   4096 Dec 13 11:14 conf-rwxr-xr-x 1 1001 1001   2502 Dec  4 22:52 configuredrwxr-xr-x 4 1001 1001   4096 Dec 13 11:14 contribdrwxr-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 Makefiledrwxr-xr-x 2 1001 1001   4096 Dec 13 11:14 mandrwxr-xr-x 3 root root   4096 Dec 13 11:17 objs-rw-r--r-- 1 1001 1001     49 Dec  4 22:52 READMEdrwxr-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]# lltotal 1052drwxr-xr-x.  2 root root    4096 Dec 11 15:38 bindrwxr-xr-x.  2 root root    4096 Apr 11  2018 etcdrwxr-xr-x.  2 root root    4096 Apr 11  2018 gamesdrwxr-xr-x   6 root root    4096 Dec 10 11:44 gitdrwxr-xr-x.  3 root root    4096 Dec 10 11:08 includedrwxr-xr-x.  4 root root    4096 Dec 10 11:08 libdrwxr-xr-x.  2 root root    4096 Apr 11  2018 lib64drwxr-xr-x.  2 root root    4096 Apr 11  2018 libexecdrwxr-xr-x   6 root root    4096 Dec 13 11:17 nginxdrwxr-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.gzdrwxr-xr-x   3 root root    4096 Dec 10 11:05 python3drwxr-xr-x  10 root root    4096 Oct 10 11:26 qclouddrwxr-xr-x.  2 root root    4096 Apr 11  2018 sbindrwxr-xr-x.  5 root root    4096 Aug  8 11:09 sharedrwxr-xr-x.  3 root root    4096 Dec 10 11:42 srcsrwxrwxrwx   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]# lltotal 16drwxr-xr-x 2 root root 4096 Dec 13 11:17 confdrwxr-xr-x 2 root root 4096 Dec 13 11:17 htmldrwxr-xr-x 2 root root 4096 Dec 13 11:17 logsdrwxr-xr-x 2 root root 4096 Dec 13 11:17 sbin[root@VM_0_7_centos nginx]#

 

转载于:https://www.cnblogs.com/BH8ANK/p/10112990.html

你可能感兴趣的文章
Java【第十篇】集合
查看>>
学习HTML第二天 学习格式标记和文本标记
查看>>
Linux常用命令
查看>>
第二周的学习
查看>>
趣谈Hbase架构
查看>>
Python_Tips
查看>>
个性化你的博客园【持续更新中!!!】
查看>>
【转】一例胜千言详谈sqlserver数据库锁
查看>>
100亿小数据实时计算平台(大数据系列目录)
查看>>
数据结构 二叉树
查看>>
JavaMe开发,模拟器打开一片空白~
查看>>
My second day of OpenCV
查看>>
用户在电商网站中购买成功了,那么它在微服务中经历了什么(转)
查看>>
arts-week2
查看>>
java笔试之自守数
查看>>
getElementsByName
查看>>
IIS 6.0上部署.NET 4.0网站
查看>>
切图基本知识
查看>>
Web--TypeConverter
查看>>
frameset 的用法 Java Web
查看>>