# 更新软件包索引
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 默认配置文件路径
sudo nginx -t
# 编辑 Nginx 配置文件
sudo nano /etc/nginx/sites-available/default
# 重启 Nginx 使配置生效
sudo systemctl restart nginx
apt
包管理器安装 Nginx。上一篇:linux 启动nginx
下一篇:linux查看端口命令
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站