Linux安装和配置Nignx_MQ

Linux安装和配置Nignx

一、Nginx下载

说明:在Linux中采用在线下载的形式,直接从Nginx的官网获取安装包

(1)官网下载地址:http://nginx.org/download/nginx-1.19.1.tar.gz

  • 右击要下载的文件,复制链接地址即可

在这里插入图片描述

(2)终端使用命令:wget 下载地址

[root@localhost src]# wget http://nginx.org/download/nginx-1.19.1.tar.gz

在这里插入图片描述

二、安装和配置Nginx

(1)解压下载好的文件

[root@localhost src]# tar -xvf nginx-1.19.1.tar.gz

在这里插入图片描述(2)配置Nginx

  • Nginx源文件目录,只负责编译,不负责执行

在这里插入图片描述

  • Nginx生成可执行文件
    步骤1: 生成可执行文件
[root@localhost nginx-1.19.1]# ./configure

在这里插入图片描述
步骤2: 编译

[root@localhost nginx-1.19.1]# make

在这里插入图片描述
步骤3: 安装nginx

[root@localhost nginx-1.19.1]# make install

在这里插入图片描述
步骤4: 获取nginx工作目录

[root@localhost nginx-1.19.1]# whereis nginx

在这里插入图片描述

  • Nginx命令

说明: 到Nginx的工作目录(运行目录): /usr/local/nginx

[root@localhost nginx-1.19.1]# whereis nginx
nginx: /usr/local/nginx
[root@localhost nginx-1.19.1]# cd /usr/local/nginx
[root@localhost nginx]# ls
conf  html  logs  sbin
[root@localhost nginx]# cd sbin/
[root@localhost sbin]# ls
nginx
[root@localhost sbin]# 

在这里插入图片描述Nginx相关命令:

  • 启动:./nginx
  • 重启:./nginx -s reload
  • 停止:./nginx -s stop
[root@localhost sbin]# ./nginx
[root@localhost sbin]# ./nginx -s reload
[root@localhost sbin]# ./nginx -s stop

结束

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值