配置Nginx遇到Active:inactive (dead)解决方法

问题:

复制代码
● nginx.service - nginx - high performance web server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: https://nginx.org/en/docs/

Oct 30 23:07:31 iZj6cfjv84u6xjdqohirooZ sh[3175338]:  -V, --version  output version information and exit
Oct 30 23:07:31 iZj6cfjv84u6xjdqohirooZ sh[3175338]: For more details see kill(1).
Oct 30 23:07:31 iZj6cfjv84u6xjdqohirooZ systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Oct 30 23:07:31 iZj6cfjv84u6xjdqohirooZ systemd[1]: nginx.service: Failed with result 'exit-code'.
Oct 30 23:07:37 iZj6cfjv84u6xjdqohirooZ systemd[1]: Starting nginx - high performance web server...
Oct 30 23:07:37 iZj6cfjv84u6xjdqohirooZ systemd[1]: nginx.service: Can't open PID file /run/nginx.pid (yet?) after start: Operation not permitted
Oct 30 23:07:37 iZj6cfjv84u6xjdqohirooZ systemd[1]: Started nginx - high performance web server.
Oct 31 18:13:28 iZj6cfjv84u6xjdqohirooZ systemd[1]: Stopping nginx - high performance web server...
Oct 31 18:13:28 iZj6cfjv84u6xjdqohirooZ systemd[1]: nginx.service: Succeeded.
Oct 31 18:13:28 iZj6cfjv84u6xjdqohirooZ systemd[1]: Stopped nginx - high performance web server.
复制代码

 

解决方法:

先运行:service nginx start

再运行:sudo systemctl status nginx

 

结果:

复制代码
● nginx.service - nginx - high performance web server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-10-31 18:36:28 CST; 4min 20s ago
       Docs: https://nginx.org/en/docs/
    Process: 3751102 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)
   Main PID: 3751103 (nginx)
      Tasks: 3 (limit: 4423)
     Memory: 2.8M
     CGroup: /system.slice/nginx.service
             ├─3751103 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
             ├─3751104 nginx: worker process
             └─3751105 nginx: worker process

Oct 31 18:36:28 iZj6cfjv84u6xjdqohirooZ systemd[1]: Starting nginx - high performance web server...
Oct 31 18:36:28 iZj6cfjv84u6xjdqohirooZ systemd[1]: Started nginx - high performance web server.
复制代码
posted @   バカなの  阅读(3416)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
点击右上角即可分享
微信分享提示