linux – 在Ubuntu中重启Nginx

我用这个sh file来安装Nginx.但是当我修改nginx.conf并尝试重新加载或重新启动Nginx时,它没有重启.
这个命令

sudo systemctl restart nginx

给我

sudo: unable to resolve host localhost.localdomain sudo: systemctl: command not found

还有这个

sudo service nginx restart

sudo: unable to resolve host localhost.localdomain nginx: unrecognized service

还有这个

sudo /etc/init.d/nginx restart

sudo: unable to resolve host localhost.localdomain sudo:
/etc/init.d/nginx: command not found
最佳答案
文件可能在那里:/usr/local/nginx / sbin / nginx
确定你可以这样做:

ps aux | grep nginx

杀死进程:

sudo killall nginx

然后重新开始:

/usr/local/nginx/sbin/nginx

转载注明原文:linux – 在Ubuntu中重启Nginx - 代码日志