I tried systemctl status nginx
and got
Unit nginx.service could not be found.
The server is currently running nginx
I use ps -ef | grep nginx
and it returns info of nginx
root 6475 4292 0 16:58 pts/0 00:00:00 grep --color=auto nginx
nobody 31104 31334 0 Apr01 ? 00:00:13 nginx: worker process
root 31334 1 0 Jan25 ? 00:00:00 nginx: master process /usr/local/nginx-1.20.2/sbin/nginx -c /usr/local/nginx-1.20.2/conf/nginx.conf
how to restart this nginx?
2
Answers
I found how to do it
find process of nginx
then kill all these process
then
-c /usr/local/nginx-1.20.2/conf/nginx.conf
is the config file optionSeems, like you lost your nginx.service file (basically, located in /lib/systemd/system/nginx.service).
Try to reinstall nginx: