Apache Check
A quick way to check your httpd.conf file is:
# /usr/local/apache/bin/httpd -t
Script for restarting Apache when server load is over 100
#!/bin/bash
cl=`awk '{print $1}' /proc/loadavg `
cll=`printf %.0f $cl`
echo $cll
if [ $cll -gt 100 ]
then
/etc/init.d/apache restart
fi
When the load is high run this command and let us know the output:
netstat -n | grep :80 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
Below is the cPanel graceful Apache restart command:
/usr/local/cpanel/scripts/restartsrv_apache
Leave a Comment