Ubuntu20.04 安装 nginx

文章背景

安装 nginx ,用 apt-get 包管理工具安装,简单快捷。

文章目标

  1. 换国内源+更新软件源;
  2. 使用apt-get包管理工具安装 nginx 。

1. 换国内源+更新软件源

Ubuntu 20.04.3 桌面版换源的两种方法

2. 使用apt-get包管理工具安装 nginx

使用 root 权限安装,避免权限问题导致安装失败。

sudo su root
apt-get install nginx

安装完成后,使用 nginx 命令查看版本,测试是否成功。

nginx -v

运行服务,并设置开机自动启动。

systemctl start nginx
systemctl enable nginx

致谢

  1. ubuntu安装nginx
作者:ninesun原文地址:https://segmentfault.com/a/1190000042749392

%s 个评论

要回复文章请先登录注册