首页 > 系统相关 >配置Nginx遇到Active:inactive (dead)解决方法

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

时间:2022-10-31 18:58:42浏览次数:59  
标签:systemd service nginx 31 dead iZj6cfjv84u6xjdqohirooZ Nginx inactive Oct

问题:

● 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.

标签:systemd,service,nginx,31,dead,iZj6cfjv84u6xjdqohirooZ,Nginx,inactive,Oct
From: https://www.cnblogs.com/eisenshu/p/16845344.html

相关文章

  • sudo ufw status输出status:inactive解决方法
    先运行:sudoufwenable输出:Commandmaydisruptexistingsshconnections.Proceedwithoperation(y|n)?yFirewallisactiveandenabledonsystemstartup再运行:s......
  • Nginx配置godaddy证书
    在阿里云上购买的证书下载直接上传服务器配置到Nginx就可以直接使用,但是godaddy的需要自己手动生成证书:1.在网站:https://www.myssl.cn/tools/create-csr.html上生成KEY及......
  • Nginx学习六:静态代理
    文章目录​​一、原因​​​​二、原理图​​​​三、Nginx静态代理实现方式​​​​方式一:在nginx.conf的location中配置静态资源的后缀​​​​方式二在nginx.conf的lo......
  • nginx容器与php-fpm容器连接方式
    文档说明:只记录关键地方;获得nginx和php基础镜像的内默认配置文件从容器镜像中拷贝文件到容器外#!/bin/bashset-eux__DIR__=$(cd"$(dirname"$0")"pwd)c......
  • nginx load balance
    loadbalancehttps://zhuanlan.zhihu.com/p/64777456 四层负载均衡(tcp)在三层负载均衡的基础上,用ip+port接收请求,再转发到对应的机器。七层负载均衡(http)根据虚拟......
  • Nginx源码编译并运行
    获取源码包并解压登录http://nginx.org/en/download.htmlwgethttp://nginx.org/download/nginx-1.20.2.tar.gztar-zxvfnginx-1.20.2.tar.gz安装Nginxcdnginx-1.2......
  • nginx 客户端返回499的错误码
    我们服务器客户端一直有返回错误码499的日志,以前觉得比例不高,就没有仔细查过,最近有领导问这个问题,为什么耗时只有0.0几秒,为啥还499了?最近几天就把这个问题跟踪定位了一下,......
  • nginx容器与php容器连接
    文档说明:只记录关键地方;试验环境:linuxdebian11目标:nginx容器与php容器连接构建PHP容器curl-fsSL'https://curl.haxx.se/ca/cacert.pem'-o/usr/local/etc/p......
  • ELK部署-实现Nginx日志收集
    一、部署ES1、创建网络下载镜像dockernetworkcreateelasticdockerpullelasticsearch:7.17.62、目录准备mkdir/opt/ELK/elastic/{data,config}-pchmod777/o......
  • phpstudy出现乱码导致Apache或者Nginx无法启动
    今天在使用Phpstudy的时候,突然无法创建新站点了(好久没用过了)。错误提示如下:(注意截图位置,端口和时间都是乱码)    经过查阅大量资料,原来是软件的编码格式导致......