前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【CentOS_7】安装nginx

【CentOS_7】安装nginx

作者头像
BH8ANK
发布2021-01-29 12:13:20
3150
发布2021-01-29 12:13:20
举报
文章被收录于专栏:云技术分享云技术分享

1,下载

代码语言:javascript
复制
[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,解压

代码语言:javascript
复制
[root@VM_0_7_centos local]# tar -zxvf nginx-1.14.2.tar.gz 

3,设置

代码语言:javascript
复制
[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,编译安装

代码语言:javascript
复制
[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,检查安装是否完成

代码语言:javascript
复制
[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]#  
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018-12-13 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档