RHEL 7でhttpdを起動できません。

RHEL 7でhttpdを起動できません。

RHEL 7でhttpdを起動できません。

[root@machine]# systemctl restart httpd
Failed to restart httpd.service: Unit not found.

頑張った…

yum update -y
yum install httpd -y
systemctl restart httpd

同じ結果。 Apacheの設定はOKです。

[root@machine]# httpd -t
Syntax OK

Red Hat Enterprise Linuxサーバーバージョン7.7(Maipo)


[root@machine me]# rpm -q httpd
httpd-2.4.6-90.el7.x86_64

...

[root@machine me]# systemctl status httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2020-01-27 15:38:54 CST; 1 day 16h ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 36851 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 36849 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 36849 (code=exited, status=1/FAILURE)

Jan 27 15:38:54 faspbsy0002 httpd[36849]: (98)Address already in use: AH0007...0
Jan 27 15:38:54 faspbsy0002 httpd[36849]: (98)Address already in use: AH0007...0
Jan 27 15:38:54 faspbsy0002 httpd[36849]: no listening sockets available, sh...n
Jan 27 15:38:54 faspbsy0002 httpd[36849]: AH00015: Unable to open logs
Jan 27 15:38:54 faspbsy0002 systemd[1]: httpd.service: main process exited, ...E
Jan 27 15:38:54 faspbsy0002 kill[36851]: kill: cannot find process ""
Jan 27 15:38:54 faspbsy0002 systemd[1]: httpd.service: control process exite...1
Jan 27 15:38:54 faspbsy0002 systemd[1]: Failed to start The Apache HTTP Server.
Jan 27 15:38:54 faspbsy0002 systemd[1]: Unit httpd.service entered failed state.
Jan 27 15:38:54 faspbsy0002 systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

ベストアンサー1

httpd見つからないデバイスが正しくサービスされていないようです。

以下を試してください

systemctl is-enabled httpd
systemctl is-active httpd

両方が再び表示される場合は、まず構成をバックアップして再インストールしてunit not foundみてください。httpd

yum remove httpd

yum search apache
yum install httpd

おすすめ記事