# 更新软件包列表
sudo apt update
# 安装 Nginx
sudo apt install nginx
# 启动 Nginx 服务
sudo systemctl start nginx
# 设置 Nginx 开机自启动
sudo systemctl enable nginx
# 检查 Nginx 是否正在运行
sudo systemctl status nginx
# 配置防火墙以允许 HTTP 和 HTTPS 流量
sudo ufw allow 'Nginx Full'
# 查看 Nginx 默认页面(确保安装成功)
curl http://localhost
apt update 命令来更新本地的软件包列表,确保获取最新的软件包信息。apt install nginx 安装 Nginx。systemctl start nginx 启动 Nginx 服务。systemctl enable nginx 设置 Nginx 在系统启动时自动启动。systemctl status nginx 检查 Nginx 服务的状态,确保它正在运行。ufw allow 'Nginx Full' 允许 HTTP 和 HTTPS 流量通过防火墙。curl http://localhost 查看 Nginx 的默认欢迎页面,确认安装成功。上一篇:linux复制文件夹到指定目录
下一篇:linux 重命名文件
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站