Ubuntu上nginx常用命令

 

错误截图

 

启用nginx 

systemctl start nginx

停止

systemctl stop nginx

重启

systemctl restart nginx

 

检查nginx配置文件是否正确

nginx -t -c /etc/nginx/nginx.conf

修改配置文件后,重新加载配置文件命令

nginx -s reload

 

查看nginx服务状态,根据服务状态去判断报错原因

systemctl status nginx.service

 

常见错误 端口被占用

查看80端口命令

netstat -nap | grep 80

 

停止杀掉占用端口的进程号

kill -9 pid

posted @ 2024-04-01 11:05  qingjiawen  阅读(62)  评论(0编辑  收藏  举报