Hi,
I found a nice script to automatically restart Apache (if it's down). Hopefully, this will control the downtime on server 1
Here's the script:
| Code: |
checkapache=`ps ax | grep -v grep | grep -c httpd`
if [ $checkapache -le 0 ]
then
/etc/init.d/httpd restart
fi
|
Nice and simple
It just checks if httpd is on the process list, and if not, restart it. Quite a nice little script.
Just set that to run every 10 minutes as a cron job on the server (it will cause very little server load, if any, it takes less than a second to check if Apache is running), and our Apache problems are solved.
What about mySQL? What about Eximstats? What about POP3?
Directadmin does them all
.
That script won't help. Lately apache just stops working, but is still running. (so the script will think it is up)
| Bondings wrote: |
| That script won't help. Lately apache just stops working, but is still running. (so the script will think it is up) |
Well, maybe the data centre can help you sort it out?
Would an upgrade to Apache 2 help?
| daniel15 wrote: |
| Bondings wrote: | | That script won't help. Lately apache just stops working, but is still running. (so the script will think it is up) |
Well, maybe the data centre can help you sort it out?
Would an upgrade to Apache 2 help? |
He won't upgrade to Apache 2
.
I guess switching to Directadmin and totally getting rid of cPanel will help
.
perhaps load a web page from server 1 if page load fails reboot apache?
| Rhysige wrote: |
| perhaps load a web page from server 1 if page load fails reboot apache? |
To reboot apache, you need a shell script. Or just do it from WHM which is an hassle.
WHM = Web Host Manager.
Use lynx commandline or cURL to fetch a page on the server within in a shell script and restart apache based on what it returns.
Wow...other people feel my pain.
But really... I used samba remote computer using for my network...
if cpanel is that big of an issue...then uhh...look into some remote software
| simplyw00x wrote: |
| Use lynx commandline or cURL to fetch a page on the server within in a shell script and restart apache based on what it returns. |
Nice idea... What about a shell script that runs wget http://www.frihost.com/ and checks if Apache is working? That would be great!
Only problem is I don't have much shell scripting experience (that script I posted was just sitting on my hard drive from ages ago). Maybe if someone writes up a script, Bondings could implement it?
I think to restart apache, you need to run /etc/init.d/httpd restart or apachectl -k restart (can't remember which, I'm not good with Linux programming)