Oct
23
2009
23
2009
Uncategorized
Automatic Server Restart in linux.
In windows , if the server shutdown or crashed ,it will automatically restart , if we installed apache as service.
But i linux server we needs to write a shell program to do this.
#!/bin/bash
if [ ‘ps -waux | grep -v grep | grep -c httpd’ -lt 1
]; then apachectl restart; fi
By using the above script we can able to achive this.
1. We needs to give executable permission for the script and we needs to add this script in cron configuration.
Like this we can also able to send a notification  , when the server shutdown.

An article by admin




