配置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.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本