安装命令
apt update
apt install nginx
检查Nginx服务的状态
systemctl status nginx
检查Nginx Web服务器的版本
nginx -v
默认配置文件
/etc/nginx/sites-available/default
多站点配置文件目录
/etc/nginx/conf.d
默认网站目录文件夹
root /var/www/html
Nginx 管理命令:
//使用nginx -t 命令检验配置文件的语法是否可用
nginx -t
//启动Nginx服务:
systemctl start nginx
//停止Nginx服务:
systemctl stop nginx
//重新启动Nginx服务:
systemctl restart nginx
//重新加载Nginx服务:
systemctl reload nginx
//启用Nginx服务以在启动时启动:
systemctl enable nginx
//禁用Nginx服务,使其无法在启动时启动:
systemctl disable nginx
文章评论