- Apache Performance Tuning: Swap Memory
- Apache Performance Tuning: MPM Modules
- Apache Performance Tuning: MPM Directives
- Apache Performance Tuning: Configuring MPM Directives
- How to Enable Piped Logging in Apache
Our previous article in this series focused on defining and fitting MPM to match your environment. Building from our last tutorial we will be discussing specific details on how to adjust the previously mentioned Apache configuration directives on the various types of Liquid Web VPS servers as well as Core managed servers.
On CentOS servers, Apache configuration files are located in /etc/httpd/.
- Log in to the server over SSH or FTP.
- First, create an optimization file. It’s necessary for the optimization file to be loaded last so that it will override all other previous settings. We suggest naming the file z-optimize.conf.
touch /etc/httpd/conf.d/z-optimize.conf
- Open file for editing with your favorite editor:
vim /etc/httpd/conf.d/z-optimize.conf
- Input necessary directive change, using IfModule statements for compatibility.
- Save the file.
- Reload Apache.
service httpd restart
On Ubuntu servers, Apache configuration files are located in /etc/apache2/.
- Backup existing apache2.conf file:
cp -p /etc/apache2/apache2.conf{,.bak.$(date +%F_%H%M%S)}
ls -lah /etc/apache2/apache2.conf* - Open file for editing with your favorite editor:
vim /etc/apache2/apache2.conf
- Append the necessary directive changes to the very bottom of the config file.
- Save the file.
- Reload Apache.
apache2ctl reload
Out of the box, our Fully-Managed cPanel servers come with general optimization suitable for most small and mid-range sites. cPanel servers use a sophisticated template system for managing Apache configurations. cPanel typically handles all configurations seamlessly by using the WHM and cPanel interfaces. However, it is still quite simple to set up an optimization configuration file. You have the choice to compose an optimized configuration file via command line over SSH/FTP or within the WHM interface.
Command Line Method (SSH/FTP)
The Apache configuration files on cPanel servers are stored in: /usr/local/apache/conf/includes/
You can use several included files for optimization. It’s necessary for the optimization file to be loaded last so that it will override all other previous settings. For this reason, the post_ include files work best, specifically the post_virtualhost_global.conf file.
- Log in to the server with SSH or FTP.
- Open the post_virtualhost_global.conf file in your favorite editor. (This file is typically empty and maybe missing entirely. This is okay and not unexpected.)
vim /usr/local/apache/conf/includes/post_virtualhost_global.conf
- Input necessary directive change, using IfModule statements for compatibility.
- Save the file.
- Reload Apache.
/scripts/restartsrv_apache
- Reload Apache PHP FPM servers.
/scripts/restartsrv_apache_php_fpm
WMH Method
- Log in to Webhost Manager (WHM) on the necessary server.
- Type apache in the quick find box.
- Click on Apache Configuration in the Service Configuration section.
- Click on Include Editor.
- Scroll down to Post VirtualHost Include.
- Select All Versions from the drop down.
- In the box input the necessary directives for optimization.
- Click the Update button when finished to save the change.
- On the left-hand navigation pane in the Restart Services section at the bottom click on HTTP Server(Apache).
- Click on the Yes button.
- Back to the left-hand navigation pane in the Restart Services section at the bottom click on PHP-FPM services for Apache.
- Click on the Yes button to complete the configuration.
Out of the box, our Fully-Managed Linux Plesk servers come with general optimization suitable for most small and mid-range sites. Plesk uses mostly a standard CentOS based Apache2 installation so that it can be modified in the same manner as our Core-managed CentOS 6/7 servers:
On CentOS servers, Apache configuration files are located in /etc/httpd/.
- Log in to the server over SSH or FTP.
- First, create an optimization file. It’s necessary for the optimization file to be loaded last so that it will override all other previous settings. Suggested name: z-optimize.conf.
touch /etc/httpd/conf.d/z-optimize.conf
- Open file for editing with your favorite editor:
vim /etc/httpd/conf.d/z-optimize.conf
- Input necessary directive change, using IfModule statements for compatibility.
- Save the file.
- Reload Apache.
service httpd restart
Our Heroic Support™ team is equipped with talented and knowledgeable techs who can discuss ways to enhance your environment. After reading through our series if you still have questions our techs can walk you through the outlined steps. For our customer with Fully Managed servers, we are happy to pick up the torch and take the lead by directly implementing the changes in this article. We are just a phone call, chat or ticket away from aiding you through the process.
Related Articles:
- Using MySQL Command Line to Create a User
- How to Use Disk Quotas in Dedicated Linux Servers With cPanel
- How to Use Disk Quotas in Dedicated Linux Servers with Plesk
- Remove a MySQL User on Linux via Command Line
- Remove Permissions for a MySQL User on Linux via Command Line
- Grant Permissions to a MySQL User on Linux via Command Line

About the Author: Jason Potter
A veteran of the IT Support field, I have more than a decade of experience in systems administration, web hosting, and cPanel servers. I enjoy writing and providing complicated technical concepts in layman terms. On my free time, I enjoy playing several types video games, automation scripting and just living life with my wife and two kids.
Our Sales and Support teams are available 24 hours by phone or e-mail to assist.
Latest Articles
ChatGPT Integration — How to Create a Plugin for ChatGPT
Read ArticleWhat is CentOS? Everything You Need to Know
Read ArticleWhat is CentOS? Everything You Need to Know
Read ArticleRedis as Cache: How It Works and Why You Should Use It
Read ArticleRefer-a-Friend Program for Website Hosting: Get $100 for Each Friend!
Read Article