centos8 安装最新nginx

这里写自定义目录标题

连接成功
Activate the web console with: systemctl enable --now cockpit.socket

There were 534 failed login attempts since the last successful login.
Last login: Thu Jan  1 08:00:10 1970
[root@VM-16-15-centos ~]# ls
[root@VM-16-15-centos ~]# cat /etc/redhat-release 
CentOS Linux release 8.2.2004 (Core) 
[root@VM-16-15-centos ~]# ls
[root@VM-16-15-centos ~]# pwd
/root
[root@VM-16-15-centos ~]# ls
[root@VM-16-15-centos ~]# cd ..
[root@VM-16-15-centos /]# ls
bin  boot  data  dev  etc  home  lib  lib64  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
[root@VM-16-15-centos /]# cd data/
[root@VM-16-15-centos data]# ls
[root@VM-16-15-centos data]# mkdir server
[root@VM-16-15-centos data]# ls
server
[root@VM-16-15-centos data]# cd server/
[root@VM-16-15-centos server]# ls
[root@VM-16-15-centos server]# yum -y install gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
上次元数据过期检查:1:33:58 前,执行于 20211210日 星期五 124907秒。

完毕!
[root@VM-16-15-centos server]# wget -c https://nginx.org/download/nginx-1.21.4.tar.gz
--2021-12-10 14:27:05--  https://nginx.org/download/nginx-1.21.4.tar.gz

已发出 HTTP 请求,正在等待回应... 200 OK
长度:1070260 (1.0M) [application/octet-stream]
正在保存至: “nginx-1.21.4.tar.gz”

nginx-1.21.4.tar.gz             100%[=======================================================>]   1.02M  1.19MB/s  用时 0.9s    

2021-12-10 14:27:07 (1.19 MB/s) - 已保存 “nginx-1.21.4.tar.gz” [1070260/1070260])

[root@VM-16-15-centos server]# ls
nginx-1.21.4.tar.gz
[root@VM-16-15-centos server]# tar -xzvf nginx-1.21.4.tar.gz 
nginx-1.21.4/

nginx-1.21.4/auto/cc/sunc
[root@VM-16-15-centos server]# ls
nginx-1.21.4  nginx-1.21.4.tar.gz
[root@VM-16-15-centos server]# mv nginx-1.21.4 nginx
[root@VM-16-15-centos server]# ls
nginx  nginx-1.21.4.tar.gz
[root@VM-16-15-centos server]# cd nginx/
[root@VM-16-15-centos nginx]# ls
auto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  man  README  src
[root@VM-16-15-centos nginx]# ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_sub_module --with-http_gzip_static_module --with-pcre


[root@VM-16-15-centos nginx]# make && make install
make -f objs/Makefile
make[1]: 进入目录“/data/server/nginx”

test -d '/usr/local/nginx/logs' \
        || mkdir -p '/usr/local/nginx/logs'
make[1]: 离开目录“/data/server/nginx”
[root@VM-16-15-centos nginx]# 
[root@VM-16-15-centos nginx]# ls
auto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  Makefile  man  objs  README  src
[root@VM-16-15-centos nginx]# cd /usr/local/nginx/
[root@VM-16-15-centos nginx]# ls
conf  html  logs  sbin
[root@VM-16-15-centos nginx]# cd sbin/
[root@VM-16-15-centos sbin]# ls
nginx
[root@VM-16-15-centos sbin]# ./nginx
[root@VM-16-15-centos sbin]# 


验证nginx启动成功。

在这里插入图片描述

其他命令说明
./nginx -s quit:   (温和)此方式停止步骤是待nginx进程处理任务完毕进行停止。
./nginx -s stop:   (强硬)此方式相当于先查出nginx进程id再使用kill命令强制杀掉进程。
./nginx -s reload   重启nginx(不推荐此方法,推荐先停止在启动)
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值