Auto Restart apache when connection is high
In some situations, our web server receive too many connections. The number is much higher than normal, that could be an issue with our code, or we are being attack. While waiting to find a solution, we need a solution to keep the service running. The easiest solution is to restart our web server when it’s go over our limit. We’ll keep the log what the server is running, then restart the server. Later on we can see our log and do the fine tuning. cnt=ps -Af | grep apache2 | grep -v rotatelogs | grep -v grep | wc -l
now=date +%Y-%m-%d_%H-%M
# changeRead More →