gpt4 book ai didi

linux - 在 httpd.conf 中找不到 Httpd 配置值 (Amazon AWS EC2)

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:24:35 28 4
gpt4 key购买 nike

我正在使用免费套餐 Amazon AWS EC2 微型实例并托管一个 Wordpress 网站。由于内存太低,我总是会出现“Error Establishing to Database”之类的常见错误,从日志中我可以看到http进程占用了内存。这导致了web服务停止。

我已经调整了我的 MySQL 配置文件,现在我想调整 http 配置。我喜欢在我的 httpd.conf 中应用以下内容

Timeout 30
KeepAlive On
MaxKeepAliveRequests 50
KeepAliveTimeout 10

<IfModule prefork.c>
StartServers 3
MinSpareServers 2
MaxSpareServers 5
MaxClients 10
MaxRequestsPerChild 1000
</IfModule>

但由于某些原因,我无法在文件中找到上述信息。我需要手动添加吗?它在别的地方吗?我试图在另一个文件夹中找到它,但找不到任何东西。顺便说一句,我不是 Linux 专家。我很感激任何关于这方面的指导。

我的 Linux 版本是 Amazon Linux AMI 版本 2016.03。谢谢。

最佳答案

主要配置文件:

- /etc/httpd/conf/httpd.conf

其他配置加载文件:

- conf.modules.d/*.conf
- conf.d/*.conf

MPM 配置文件:

/etc/httpd/conf.modules.d/00-mpm.conf

您找不到该部分,因为亚马逊使用默认配置。在此文件末尾添加您的代码:

<IfModule prefork.c>
StartServers 3
MinSpareServers 2
MaxSpareServers 5
ServerLimit 10
MaxClients 10
MaxRequestsPerChild 100
</IfModule>

并重启 Apache 服务器:

sudo service httpd restart

来源:https://www.pauloacosta.com/2019/09/onde-fica-o-arquivo-de-configuracao-do.html

关于linux - 在 httpd.conf 中找不到 Httpd 配置值 (Amazon AWS EC2),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37451066/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com