当我尝试启动 apache 服务器时,出现以下信息: 我构建了2.4.6版本并放置在本地位置。
[apacheas@twproxy1 bin]$ ./apachectl -k start
AH00534: httpd: Configuration error: More than one MPM loaded.
根据某些网站上提供的一些信息,我尝试列出可用的模块(不确定!)如下。
[apacheas@twproxy1 bin]$ ./httpd -l
Compiled in modules:
core.c
mod_so.c
http_core.c
event.c
可能出了什么问题?
这与最近 openssl 中的 Heart Bleed bug 有关——为此我们被建议升级 apache 和 openssl 版本。 我们都做了,但还是遇到了上述问题/
检查 mods-enabled 目录中所有启用的 mods。如果您已启用
mpm_prefork
,则应禁用 worker
模块。
sudo a2dismod worker
sudo service apache2 restart
查看:
/etc/httpd/conf.modules.d
您会发现一个名为:
00-mpm.conf
的文件
您只能取消注释这 3 行中的一行:
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
#LoadModule mpm_event_module modules/mod_mpm_event.so
在 Ubuntu 中解决方案与上面相同,但只有文件不同:
cd /etc/apache2/mods-enabled
root@ip:/etc/apache2/mods-enabled# ll mpm_*
lrwxrwxrwx 1 root root 32 Jun 30 10:33 mpm_event.conf -> ../mods-available/mpm_event.conf
lrwxrwxrwx 1 root root 32 Jun 30 10:33 mpm_event.load -> ../mods-available/mpm_event.load
lrwxrwxrwx 1 root root 34 Jun 30 11:36 mpm_prefork.conf -> ../mods-available/mpm_prefork.conf
lrwxrwxrwx 1 root root 34 Jun 30 11:36 mpm_prefork.load -> ../mods-available/mpm_prefork.load
root@ip:/etc/apache2/mods-enabled# cat mpm_event.load
# Conflicts: mpm_worker mpm_prefork mpm_itk
#LoadModule mpm_event_module /usr/lib/apache2/modules/mod_mpm_event.so
root@ip-10-0-0-249:/etc/apache2/mods-enabled# cat mpm_prefork.load
# Conflicts: mpm_event mpm_worker mpm_itk
LoadModule mpm_prefork_module /usr/lib/apache2/modules/mod_mpm_prefork.so
即注释掉以上任一模块
root@ip:/etc/apache2/mods-enabled# service apache2 restart
这样就可以了!!这对我有用!
要修复更新 Apache 后 Centos 7.0 下的“加载多个 MPM”错误,请尝试以下操作:
sudo vim /etc/httpd/conf.modules.d/00-mpm.conf
并评论这一行
#Change from
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#To
#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
问题在于正在加载多个多处理模块,这意味着 Apache 无法决定应使用哪种模型,从而导致此错误。
我有同样的问题,将 rhel OS 7.9 迁移到 8.6 后启动 httpd 时出现“加载多个 MPM”错误。按照上面的解决办法,还是无法启动httpd。
# vi /etc/httpd/conf.modules.d/00-mpm.conf
#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
LoadModule mpm_event_module modules/mod_mpm_event.so
启动httpd:
# systemctl start httpd
Job for httpd.service failed because the control process exited with error code.
See "systemctl status httpd.service" and "journalctl -xe" for details.
# journalctl -xe
-- Support: https://access.redhat.com/support
--
-- Unit httpd.service has failed.
--
-- The result is failed.
Sep 25 08:53:25 lab-sailpoint systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun start-up
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit httpd.service has begun starting up.
Sep 25 08:53:25 lab-sailpoint httpd[2727]: [Mon Sep 25 08:53:25.603223 2023] [so:warn] [pid 2727] >
Sep 25 08:53:25 lab-sailpoint httpd[2727]: [Mon Sep 25 08:53:25.603314 2023] [so:warn] [pid 2727] >
Sep 25 08:53:25 lab-sailpoint httpd[2727]: [Mon Sep 25 08:53:25.603323 2023] [so:warn] [pid 2727] >
Sep 25 08:53:25 lab-sailpoint httpd[2727]: [Mon Sep 25 08:53:25.603331 2023] [so:warn] [pid 2727] >
Sep 25 08:53:25 lab-sailpoint httpd[2727]: [Mon Sep 25 08:53:25.603338 2023] [so:warn] [pid 2727] >
Sep 25 08:53:25 lab-sailpoint httpd[2727]: [Mon Sep 25 08:53:25.603345 2023] [so:warn] [pid 2727] >
Sep 25 08:53:25 lab-sailpoint httpd[2727]: [Mon Sep 25 08:53:25.603353 2023] [so:warn] [pid 2727] >
Sep 25 08:53:25 lab-sailpoint httpd[2727]: [Mon Sep 25 08:53:25.603361 2023] [so:warn] [pid 2727] >
Sep 25 08:53:25 lab-sailpoint httpd[2727]: [Mon Sep 25 08:53:25.603367 2023] [so:warn] [pid 2727] >
Sep 25 08:53:25 lab-sailpoint httpd[2727]: [Mon Sep 25 08:53:25.603374 2023] [so:warn] [pid 2727] >
Sep 25 08:53:25 lab-sailpoint httpd[2727]: [Mon Sep 25 08:53:25.603381 2023] [so:warn] [pid 2727] >
Sep 25 08:53:25 lab-sailpoint httpd[2727]: [Mon Sep 25 08:53:25.603387 2023] [so:warn] [pid 2727] >
Sep 25 08:53:25 lab-sailpoint httpd[2727]: [Mon Sep 25 08:53:25.603395 2023] [so:warn] [pid 2727] >
Sep 25 08:53:25 lab-sailpoint httpd[2727]: [Mon Sep 25 08:53:25.603402 2023] [so:warn] [pid 2727] >
Sep 25 08:53:25 lab-sailpoint systemd[1]: httpd.service: Main process exited, code=exited, status=>
Sep 25 08:53:25 lab-sailpoint systemd[1]: httpd.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- The unit httpd.service has entered the 'failed' state with result 'exit-code'.
Sep 25 08:53:25 lab-sailpoint systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit httpd.service has failed.
--
-- The result is failed.
错误日志显示:
# vi /etc/httpd/logs/error_log
[Mon Sep 25 08:53:25.613879 2023] [core:notice] [pid 2727] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Mon Sep 25 08:53:25.621473 2023] [suexec:notice] [pid 2727] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
AH00016: Configuration Failed
# getenforce
Enforcing
我在这里做错了什么?现在,我无法进行任何 yum 更新
# yum update
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) 881 B/s | 370 B 00:00
Errors during downloading metadata for repository 'rhel-8-for-x86_64-appstream-rpms':
- Status code: 403 for https://cdn.redhat.com/content/dist/rhel8/8.6/x86_64/appstream/os/repodata/repomd.xml (IP: 23.13.176.251)
Error: Failed to download metadata for repo 'rhel-8-for-x86_64-appstream-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
我尝试过解决方法,但仍然遇到上述问题/