Apache-2.4

無法更改“MaxSpareServers”?

  • January 20, 2022

我想增加MaxSpareServers.

<IfModule mpm_prefork_module>
MaxSpareServers      20
</IfModule>

但是,我在測試時收到以下錯誤。

[root@server_1 conf.modules.d]# httpd -t
AH00526: Syntax error on line 26 of /etc/httpd/conf.modules.d/00-mpm.conf:
Invalid command 'MaxSpareServers', perhaps misspelled or defined by a module not included in the server configuration

然後我驗證了幾個點,例如 MPM 選擇

[root@server_1 worker]# httpd -V | grep -i mpm
Server MPM:     worker
[root@server_1 worker]# httpd -M | grep -i mpm
mpm_worker_module (shared)

奇怪的是,當我檢查載入的模組時,我找不到worker.c

[root@server_1 worker]# httpd -l
Compiled in modules:
 core.c
 mod_so.c
 http_core.c

這可能是無法更改伺服器配置的原因MaxSpareServers嗎?如果是這樣,我該如何解決這個問題?

請參閱下面的版本詳細資訊

[root@server_1 worker]# yum info httpd
Loaded plugins: auto-update-debuginfo, changelog, fastestmirror, product-id, search-disabled-repos, subscription-manager

Loading mirror speeds from cached hostfile
Installed Packages
Name        : httpd
Arch        : x86_64
Version     : 2.4.52
Release     : 1.codeit.el7
Size        : 4.3 M
Repo        : installed
From repo   : CodeIT
Summary     : Apache HTTP Server
URL         : https://httpd.apache.org/
License     : ASL 2.0
Description : The Apache HTTP Server is a powerful, efficient, and extensible
           : web server.

您正在執行mpm_worker_module,但MaxSpareServers定義為mpm_prefork_module.

引用自:https://serverfault.com/questions/1090594