Category Archives: Apache

The Apache Tuner Script

Note:  You may have to install bc from a yum repos for this script to work.  Also, apache must be running. If you need to troubleshoot and optimally configure Apache based on your current load, I highly recommend putting this shell script in a file named and giving it execute permissions. This will tell you… Read More »

Lock down web site directory in Apache

First, make sure you Virtual Host container with your site configuration has the following section: <Directory “/var/www/path/to/your/website/html”> allow from all Options -Indexes AllowOverride All </Directory> This will you to create .htaccess files to have directory level control over certain sections of your site.  Next, we need to create the .htaccess file.  Go to your web… Read More »

Apache – Javascript and Image Caching

If you use the mod status module and you find that javascript and images are killing your Apache performance and using a lot of resources but you can not afford CDN services, here is a solution.  First, confirm you have the mod_expires module installed in Apache.  Searching the module under /etc/httpd/conf/httpd.conf will show you if… Read More »

Apache rewrite rules

To rewrite a to use this rule in the VHost config: RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.(.*) RewriteRule ^(.*)$ https://%1/$1 [R=301,L] Also for a simple redirect from http to https you can do the following: Redirect permanent / As I come up with good rewrite rules, I will add them here!

Apache mod_status for troubleshooting

This module will help you in the event that Apache is using a lot of CPU or causing performance problems.  If this occurs, follow these instructions to enable the server status module and identify where the problem lies. Essentially, you’ll just want to modify your /etc/httpd/conf/httpd.conf file (location may vary depending on distro) and… Read More »