我的服务器 CentOs7 有问题。我安装了 httpd,它运行良好,但由于某种原因我重新安装了,但之后它就再也不工作了,而且会抛出错误。有什么方法可以删除所有 httpd 文件吗?
我尝试删除/usr/lib/systemd/system/httpd.service
和/usr/sbin/httpd
和/etc/httpd
,但是当我删除httpd和httpd-tools时它再次抛出错误:
httpd.service 作业失败。请参阅“systemctl status httpd.service”和“journalctl -xe”了解详情。
systemctl 状态 httpd.service:
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: failed (Result: protocol) since Tue 2021-02-23 04:13:01 EST; 21s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 5396 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=0/SUCCESS)
Main PID: 5396 (code=exited, status=0/SUCCESS)
Feb 23 04:13:01 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
Feb 23 04:13:01 localhost.localdomain httpd[5396]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
Feb 23 04:13:01 localhost.localdomain httpd[5396]: httpd (pid 3043) already running
Feb 23 04:13:01 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
Feb 23 04:13:01 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
Feb 23 04:13:01 localhost.localdomain systemd[1]: httpd.service failed.
答案1
为什么要手动删除服务文件而不是简单地启动yum remove httpd
?
您是否尝试过通过 yum 删除服务,然后使用 重新安装yum install httpd
?输出结果是什么?
错误报告该服务已在运行:httpd (pid 3043) already running
結果如何ps -aux | less
?