何かのフックで /etc/httpd/conf/httpd.conf が壊れることがあり httpd が起動しないようだ。

[root@bots2 conf]# systemctl status httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since 金 2020-05-15 08:00:03 JST; 5min ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 23410 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 23410 (code=exited, status=1/FAILURE)
    
 5月 15 08:00:03 bots2.localdomain systemd[1]: Starting The Apache HTTP Server...
 5月 15 08:00:03 bots2.localdomain httpd[23410]: AH00534: httpd: Configuration error: No MPM loaded.
 5月 15 08:00:03 bots2.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
 5月 15 08:00:03 bots2.localdomain systemd[1]: Failed to start The Apache HTTP Server.
 5月 15 08:00:03 bots2.localdomain systemd[1]: Unit httpd.service entered failed state.
 5月 15 08:00:03 bots2.localdomain systemd[1]: httpd.service failed.

[root@bots2 conf]# httpd -X
AH00534: httpd: Configuration error: No MPM loaded.

失敗している環境
[root@bots2 conf]# ls -al /etc/httpd/conf/httpd.conf
-rw-r--r-- 1 root root 553  5月 15 07:52 /etc/httpd/conf/httpd.conf

[root@bots2 conf]# cat httpd.conf (こんなシンプルなのになっちゃう)
# Supplemental configuration
PerlConfigRequire /etc/httpd/conf.perl/00-default-vsite.pl
#
Include /etc/httpd/conf/vhosts/preview
<IfModule log_config_module>
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent
    
    ErrorLog "/var/log/httpd/error_log"
    
</IfModule>

問題ない環境
[root@bots2 httpd]# ls -al /etc/httpd/conf/httpd.conf
-rw-r--r-- 1 root root 11272  5月 15 08:02 /etc/httpd/conf/httpd.conf

復旧してみた
[root@bots2 httpd]# rpm -q --whatprovides /etc/httpd/conf/httpd.conf
httpd-2.4.6-93.el7.centos.x86_64

[root@bots2 conf]# rm /etc/httpd/conf/httpd.conf
[root@bots2 conf]# yum reinstall httpd-2.4.6-93.el7.centos.x86_64
[root@bots2 conf]# ls -al /etc/httpd/conf/httpd.conf
-rw-r--r-- 1 root root 11757  5月 15 08:26 /etc/httpd/conf/httpd.conf
[root@bots2 conf]# systemctl start httpd

下部が戻らないので手動で。
[root@bots2 httpd]# tail conf/httpd.conf (問題ない環境)

# Supplemental configuration
PerlConfigRequire /etc/httpd/conf.perl/00-default-vsite.pl
#
# Load config files in the "/etc/httpd/conf.d" directory, if any.
IncludeOptional conf.d/*.conf
Include conf.modules.d/*.conf             <-- このへんが無いはず
Include /etc/httpd/conf/vhosts/site1      <-- このへんが無いはず
Include /etc/httpd/conf/vhosts/site2      <-- このへんが無いはず
Include /etc/httpd/conf/vhosts/preview

httpd.conf に重ねていってるパッチが当たりきってるかは不明だけど、動いているようだ。

一応、環境。

base-blueonyx-capstone-5209R-5.20200310BX012.el7.noarch
base-blueonyx-glue-5209R-5.20200310BX012.el7.noarch
blueonyx-cd-installer-7.7-20200116.x86_64

コメントする

perl adv
perl adv