![Apache 的一些 VirtualHosts(带有 .com 域名的)停止响应,但其他的没有。](https://linux22.com/image/1634859/Apache%20%E7%9A%84%E4%B8%80%E4%BA%9B%20VirtualHosts%EF%BC%88%E5%B8%A6%E6%9C%89%20.com%20%E5%9F%9F%E5%90%8D%E7%9A%84%EF%BC%89%E5%81%9C%E6%AD%A2%E5%93%8D%E5%BA%94%EF%BC%8C%E4%BD%86%E5%85%B6%E4%BB%96%E7%9A%84%E6%B2%A1%E6%9C%89%E3%80%82.png)
我有一台 Raspberry Pi 4,为 5 个不同的网站提供服务。其中 4 个只是静态的、最小的家庭项目网站,其中一个是通过反向代理运行的 snap Nextcloud 实例。我通过 certbot 配置了每个虚拟主机的 SSL,一切都运行正常,直到今天 Nextcloud 停止响应。
检查了所有其他域名后,我发现(巧合吗?).com 域名没有响应,而其他域名有响应。
/var/log/apache2/error.log
看起来像这样:
[Wed Oct 14 19:06:13.012069 2020] [mpm_event:error] [pid 2059:tid 281473471475728] AH03490: scoreboard is full, not at MaxRequestWorkers.Increase ServerLimit.
[Wed Oct 14 19:06:14.013288 2020] [mpm_event:error] [pid 2059:tid 281473471475728] AH03490: scoreboard is full, not at MaxRequestWorkers.Increase ServerLimit.
[Wed Oct 14 19:06:15.014486 2020] [mpm_event:error] [pid 2059:tid 281473471475728] AH03490: scoreboard is full, not at MaxRequestWorkers.Increase ServerLimit.
[Wed Oct 14 19:06:16.015707 2020] [mpm_event:error] [pid 2059:tid 281473471475728] AH03490: scoreboard is full, not at MaxRequestWorkers.Increase ServerLimit.
[Wed Oct 14 19:06:17.016931 2020] [mpm_event:error] [pid 2059:tid 281473471475728] AH03490: scoreboard is full, not at MaxRequestWorkers.Increase ServerLimit.
[Wed Oct 14 19:06:18.018247 2020] [mpm_event:error] [pid 2059:tid 281473471475728] AH03490: scoreboard is full, not at MaxRequestWorkers.Increase ServerLimit.
[Wed Oct 14 19:06:19.019550 2020] [mpm_event:error] [pid 2059:tid 281473471475728] AH03490: scoreboard is full, not at MaxRequestWorkers.Increase ServerLimit.
[Wed Oct 14 19:18:31.037054 2020] [mpm_event:notice] [pid 2059:tid 281473471475728] AH00493: SIGUSR1 received. Doing graceful restart
[Wed Oct 14 19:18:31.065424 2020] [mpm_event:notice] [pid 2059:tid 281473471475728] AH00489: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Wed Oct 14 19:18:31.065478 2020] [core:notice] [pid 2059:tid 281473471475728] AH00094: Command line: '/usr/sbin/apache2'
sudo apachectl configtest
显示 OK 语法并sudo systemctl status apache2.service -l --no-pager
显示:
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2020-10-14 17:53:55 UTC; 1h 49min ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 1825 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Process: 307170 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
Main PID: 2059 (apache2)
Tasks: 163 (limit: 9258)
CGroup: /system.slice/apache2.service
├─ 2059 /usr/sbin/apache2 -k start
├─307174 /usr/sbin/apache2 -k start
├─307175 /usr/sbin/apache2 -k start
├─307230 /usr/sbin/apache2 -k start
├─307258 /usr/sbin/apache2 -k start
├─307287 /usr/sbin/apache2 -k start
└─307315 /usr/sbin/apache2 -k start
Oct 14 18:56:38 raspberrypi4 systemd[1]: Reloading The Apache HTTP Server.
Oct 14 18:56:38 raspberrypi4 systemd[1]: Reloaded The Apache HTTP Server.
Oct 14 19:00:23 raspberrypi4 systemd[1]: Reloading The Apache HTTP Server.
Oct 14 19:00:23 raspberrypi4 systemd[1]: Reloaded The Apache HTTP Server.
Oct 14 19:05:02 raspberrypi4 systemd[1]: Reloading The Apache HTTP Server.
Oct 14 19:05:02 raspberrypi4 systemd[1]: Reloaded The Apache HTTP Server.
Oct 14 19:05:18 raspberrypi4 systemd[1]: Reloading The Apache HTTP Server.
Oct 14 19:05:18 raspberrypi4 systemd[1]: Reloaded The Apache HTTP Server.
Oct 14 19:18:30 raspberrypi4 systemd[1]: Reloading The Apache HTTP Server.
Oct 14 19:18:31 raspberrypi4 systemd[1]: Reloaded The Apache HTTP Server.
我对 Apache 的经验很少,尝试/etc/apache2/mods-available/mpm_prefork.conf
添加 ServerLimit 指令(它不存在)并使用不同的值后,我仍未找到解决方案,因此我再次删除了 ServerLimit。有什么建议吗?该文件如下所示:
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxRequestWorkers 150
MaxConnectionsPerChild 0
</IfModule>