In this post i will describe how to decrease memory usage of apache2, i tried to search on google and found many solution to that problem but nothing worked for me. So i discovered a way to decrease the memory usage of apache2.
Here is the solution:
- Login to your server via putty / shell terminal with root access.
- Execute following command:
# cd /etc/apache2# nano apache2.conf
- A text editor will appear with apache2 configuration file find the below line in it:
- Replace this line with:
- Press CTRL+O to and then press [Enter] to save the changes. now run the following command:
# /etc/init.d/httpd restartOR# /etc/init.d/apache2 restartOR# service apache2 restartOR# service httpd restart
- This will restart your apache2 server and now the RAM usage will decrease to 50% guaranteed.
You can do the above configurations from your WHM/cPanel interface if you are running WHM/cPanel on your server. Follow the below steps:
- Login to your WHM/cPanel with root username and password.
- In the left panel under Service Configurations find Apache Configurations click on the link.
- The new window will appear click on first option Global Configuration
- Now find the option KeepAlive on that page and turn it to off, and then save the settings.
- On the next page you will be asked to Rebuild Configurations and restart Apache Just press that button and you are done.