# 安装 Nginx(如果尚未安装)
sudo apt update
sudo apt install nginx
# 启动 Nginx 服务
sudo systemctl start nginx
# 设置 Nginx 开机自启动
sudo systemctl enable nginx
# 检查 Nginx 状态,确保它正在运行
sudo systemctl status nginx
# 如果需要查看 Nginx 的默认配置文件路径
# 通常位于 /etc/nginx/nginx.conf 或 /etc/nginx/conf.d/
apt
包管理器进行安装。systemctl start nginx
命令来启动 Nginx 服务。systemctl enable nginx
命令可以让 Nginx 在系统启动时自动启动。systemctl status nginx
可以查看 Nginx 是否正常运行。/etc/nginx/nginx.conf
或 /etc/nginx/conf.d/
目录下,你可以根据需要修改配置文件。如果你只需要代码部分,以下是纯代码版本:
sudo apt update
sudo apt install nginx
sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl status nginx
上一篇:linux 备份命令
下一篇:linux查看文件目录
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站