Auto Restart a service every "X" amount of minutes
Currently, with the way my server is setup it runs pretty well, but one of my major services likes to hang if its up to long w/o a restart. I currently have something to restart it every so often to avoid this problem, but it runs on my computer. However, what im wondering is if theres anything server side that can do this? Maybe a cron job?
Its apache that likes to hang. I know why it hangs because my maxclients is set low. However, it must stay like this so i wont go over my VPS specs so much. Its been working perfectly with firefox autoreloadpage script. If my internet goes down than nothing will be able to autoreload the service. Thats why i need a cron job i believe.
If anyone would kind enough to write out the exact line i would add to a cron job. l'll be very thankful.
A cron is just a band-aid. You need a solution that will actual fix the root cause. If that means more tuning so you can increase maxclients and still stay in your VPS allocation, that's what really needs to be done. Or, you need to expand out and buy a larger VPS
Some very nice mini-tutorials from everyone here :-) Apart from mine, which was a bit brief in comparison :-(
I guess you are using Cpanel and will be needing to stick with Apache really, to avoid breaking/messing with Cpanel, which is never good...
What you could do though, is install something like:
Those are two web server packages that are very efficient.
What's I've seen in the past, is for people to have their main websites running on their main IP address, then a second web server server running on a secondary IP address. This can be useful in some situations, but it just depends what you need really.
Or another option as I mentioned in another post would be to have a reverse proxy server, but that's going to take quite a bit of messing about. Ugrading the VPS is probably best when you can afford it/have to.