简体   繁体   中英

Cannot Find Httpd Configuration Value in httpd.conf (Amazon AWS EC2)

I am using free tier Amazon AWS EC2 micro instance and hosting a Wordpress site. As the memory is too low, I always get common error like "Error Establishing to Database", and from the log I can see that the http process takes the memory.This causes the web service to be stopped.

I have tuned my MySQL config file and now I like to tune up the http configuration. I like to apply the things below in my httpd.conf

Timeout 30
KeepAlive On
MaxKeepAliveRequests 50
KeepAliveTimeout 10

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

But for some reason, I could not find the info above in the file. Do I need to add it manually? Is it in somewhere else? I have tried to find it in another folder but could not find anything. I am not a Linux guy by the way. I appreciate any guidance on this.

My Linux version is Amazon Linux AMI release 2016.03. Thanks.

Main configuration file:

- /etc/httpd/conf/httpd.conf

Other configuration loaded files:

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

MPM Configuration file:

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

You couldn't find the section cause Amazon uses the default configuration. Add your code in the end of this file:

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

and restart Apache server:

sudo service httpd restart

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

最好的办法是添加配置文件并在重启后监视httpd

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM