Apache2 optimizing files clarification

Hi Everyone;

I have read that since Apache 2.4 these modules ship in their own file.

, , When I follow the instructions here https://www.linode.com/docs/websites/ho … linode-2gb">https://www.linode.com/docs/websites/hosting-a-website#optimize-apache-for-a-linode-2gb it tells me to add the below to the end of my /etc/apache2/apache2.conf file.

StartServers 4

MinSpareServers 20

MaxSpareServers 40

MaxClients 200

MaxRequestsPerChild 4500

I needed to adjust my MaxRequestWorkers to a lower value which I could only find on the pre-forkmodule file. When I added MaxRequestWorkers to my apache2.conf file, it wasn't read. Yet when I adjusted it in the mpmprefork file it was read and working as expected.

This is my /etc/apache2/mods-enabled/mpm_prefork.conf file, and you can see that it looks nothing like the above file.

StartServers 5

MinSpareServers 5

MaxSpareServers 10

MaxRequestWorkers 112

MaxConnectionsPerChild 0

My questions are:

When I am trying to optimize Apache2, do I have to make these changes to both files?

Does 1 file over-ride the other?

Should both files be the same?

Any clarification with this would be greatly appreciated.

Daronna

2 Replies

You shouldn't need to make changes to both files. If I'm not mistaken, mpm_prefork.conf would be included in apache.conf, so it's reading both at once. I usually double check settings I'm changing with ApacheBuddy, which tells you how you're currently running.

Hi,

Thank you for your response. I am using ApacheBuddy and that's how I knew to adjust MaxRequestWorkers. But when I looked for MaxRequestWorkers in /etc/apache2/apache2.conf file it wasn't there, so I added it to the bottom of and restarted Apache2. I then ran ApacheBuddy again with the same results, even though the addition I added to the apache2.conf was with the number that ApacheBuddy suggested.

When I changed this number in /etc/apache2/mods-enabled/mpm_prefork.conf, restarted Apache2 and reran ApacheBuddy, it recognized my changes. I removed it from /etc/apache2/apache2.conf, restarted Apache2 and reran ApacheBuddy and still recognized MaxRequestWorkers.

This is why I am questioning which file takes precedence. ApacheBuddy did not recognize the change to apache2.conf …. but it did recognize the change in mpmprefork.conf, and my apache2.conf file is different than my mpmprefork.conf. I have entries in both files i.e. StartServers, MinSpareServers, MaxSpareServers with different numbers as you can see above.

Thank you

Daronna

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct