Top Nav

Archive | Apache

maxclients.sh Script For Apache

This script attempts to look at Apache memory usage and recommend a stable setting for MaxClients.

 

0

Apache Watch Script

Here’s a trivial old script that I sometimes use to monitor for rough processes running on the apache user:

 

0

Plesk 11 – vhost.conf File For Nginx

We’re all familier with using a vhost.conf file on Plesk to provide custom Apache directives to an individual virtual host. Originally the file was located at:

Recent versions of Plesk have moved the file to:

And of course there is an SSL version of the file at:

The good news is there’s also now a file for Nginx at:

By default these files don’t exist and are not included in the configuration. So you’ll need to create the file and then run:

or

 

0

Generate Rewrite Rules From CSV File

Here’s a simple Perl script that can be used to convert a CSV file of redirects into Apache rewrite rules:

The script assumes that you have 2 column – the source URL and the destination URL. You might invoke the script like this:

Sometimes the CSV file will be DOS formatted to I’ll do:

There are may ways that this script could be expanded or improved but it’s a good starting point for the typical case.

0

Lightweight 404 For Apple Touch Icons

Had a site recently that was complaining about bandwidth consumed by request for apple-touch-icon* files as described here:

http://mathiasbynens.be/notes/touch-icons

The customized 404 page on the site was using about 55K bytes for each request. I added the following rewrite rule:

This results in about 500 bytes per request or a 100 fold reduction.

Of course a nicer solution would be add pretty touch icons to the site!

 

 

0