Disabling RLimitMEM directive from httdp.conf?

daniel-b

Member
Jul 28, 2010
24
0
51
Hello there,

I was wondering if is it there any way to remove that line, which was added after I executed that tool in WHM >> Main >> Service Configuration >> Apache Configuration >> Memory Usage Restrictions

/usr/local/apache/conf/httpd.conf
RLimitMEM XXXXXXXXX
RLimitCPU XXX
# # # # # # # # # # # #
Comments # # # # #
# # # # # # # # # # # #
etc........
Regards.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hi,

You could comment it out, remove it or change the setting in the /var/cpanel/templates/apache2/main.default file by doing the following:

Code:
cd /var/cpanel/templates/apache2
cp main.default main.local
vi main.local
When editing main.local, you would then look for this line:

Code:
RLimitMEM [% main.rlimitmem.item.softrlimitmem %] [% main.rlimitmem.item.maxrlimitmem %]
That is the line you would want to either comment out with # at the beginning, remove it or change to hard code to a higher variable. If you change it to hard code a higher limit, you'd want to remove the stuff after RLimitMEM and put the value you want instead.

Please note you would then need to rebuild Apache and restart it for the changes to take effect:

Code:
/scripts/rebuildhttpdconf
/etc/init.d/httpd restart
As a final point, please ensure never to directly edit main.default as cPanel will overwrite those changes on each update (upcp). When you create a main.local file, Apache rebuilds and recompiles will look for that file and build httpd.conf from it.
 

daniel-b

Member
Jul 28, 2010
24
0
51
great! I got it, very useful, good to know it, thanks.

Mmm does this value come enabled by default?
RLimitCPU, or both RLimitCPU and RLimitMEM are enabled when running the tool at WHM?

Thanks!
regards.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
The value doesn't come enabled by default. It isn't there in main.default until after you select it in WHM > Apache Configuration > Memory Usage Restrictions area.
 

daniel-b

Member
Jul 28, 2010
24
0
51
Mmm OK, then everything is fine.

Thank you very much Danielle, really, I'm very grateful to you for your prompt and professional answer. This is now solved.

Good night!
 

w3dgie

Registered
May 3, 2011
1
0
51
@cPanelTristan

Just came across this page today on Google. Wanted to thank you for your simple solution. :)