Category: Scripting

maxclients.sh Script For Apache

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

 

Read More »

getpass.sh Bash Script

Simple bash script for generating random passwords. We didn’t write this and don’t know exactly where it came from.

 

Read More »

Apache Watch Script

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

 

Read More »

To Many PHP Session Files

I seen several servers with high traffic PHP sites hosted on Plesk servers building up an excessive number of PHP session files in /var/lib/php/session. Typically we discover this problem when the server runs out of inodes on the root filesystem. Plesk provides a cronjob that runs hourly to clean up PHP session files:

For low traffic sites this script work just fine. But for high traffic sites with thousands of sessions per hour the script is too slow and can’t keep up with the rate that files are created. The problem is the script check each files using the “fuser” utility to determine if the file is in use. This is a slow process. So on these high traffic servers I’ve found it necessary to remove the “fuser” check. Edit /etc/cron.hourly/plesk-php-cleanuper and change this line:

to:

Now the session cleanup will run smoothly.

Read More »

Apache mod_fcgi on CentOS 6.4

There are a lot of tutorials on how to install mod_fcgi with suexec out there but many are incomplete, outdated or just don’t work. One that does work is here: http://www.howtoforge.com/how-to-set-up-apache2-with-mod_fcgid-and-php5-on-centos-6.2  

Read More »

Categories

Get a free consultation from Reliable Penguin

Submit the form—or for immediate service call 866-649-7984.