【问题标题】:apache2 service Failed on restart - Failed to start apache2.service: Unit not foundapache2 服务重新启动失败 - 无法启动 apache2.service:未找到单元
【发布时间】:2019-08-20 10:19:57
【问题描述】:

当我尝试重新启动 apache 服务器时,我得到了以下响应。

重定向到 /bin/systemctl start apache2.service

启动 apache2.service 失败:未找到单元。

【问题讨论】:

  • 不是httpd.service吗? systemctl restart httpd
  • USER apache HOME /usr/share/httpd 这是 php 信息服务器是 apache。 @大安
  • 是的 apache 是用户,但进程是 httpd。试试systemctl restart httpdapachectl restart
  • sudo systemctl restart httpd 有效,谢谢@Daan

标签: php apache server


【解决方案1】:

您正在使用不同的 apache 服务。

如果您使用相同的服务,请运行它。

systemctl restart httpd

apachectl restart

【讨论】:

    【解决方案2】:

    如果您使用的是最新的 Linux,请尝试以下操作 - 使用以下命令检查您的服务名称

     # systemctl list-units --type service 
    

    上面的命令会列出所有的服务,找到你要重启的正确服务名 - 使用以下重启或重新加载服务 例如,我使用我的重启服务 httpd24-httpd.service

    # systemctl restart httpd24-httpd.service
    or # systemctl reload httpd24-httpd.service
    

    【讨论】:

      猜你喜欢
      • 2016-04-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-14
      • 1970-01-01
      • 2021-11-21
      • 2017-12-20
      相关资源
      最近更新 更多