apache2 服务重新启动时失败 - 无法启动 apache2.service:找不到单元



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

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

无法启动 apache2.service:未找到单元。

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

如果您使用相同的服务,请运行此选项。

systemctl restart httpd

apachectl restart

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

 # systemctl list-units --type service 

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

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

最新更新