Help - Search - Members - Calendar
Full Version: Restart Apache Automatically
The Planet Forums > System Administration > General Support Questions
theguru
Hi,

How can I restart apache automatically?

Can cron jobs help?

/etc/rc.d/init.d/httpd restart ?? Will this work in a reseller account?

Thanx,

Guru
kamihacker
QUOTE (theguru)
Hi,  

How can I restart apache automatically?

Can cron jobs help?  

/etc/rc.d/init.d/httpd restart ?? Will this work in a reseller account?

Thanx,  

Guru


http://rfxnetworks.com/sim.php

works for restarting apache automatically when it goes down

check the README , download it and install it

regards
theguru
Cpanel stars Apache when its down.

I want to do it every 3 days.
eth00
Though there is no need to if you want to restart apache every couple days a cronjob would be the best to do it automatically. You cannot do this via a reseller as you need to be root to run the commands.
JFrechA
QUOTE (theguru)
Cpanel stars Apache when its down.  

I want to do it every 3 days.



## Every three days at 6 o'clock p.m.
#crontab -e, and add the line:

0 18 */3 * * /etc/rc.d/init.d/httpd restart
theguru
Thankyou guys for the prompt reply

So, where should I insert those lines?

"Newbie" icon_biggrin.gif

Hey @ JFrechA - The APF and BDF working fine, detected and banned few icon_wink.gif
texasweb
QUOTE (theguru)
Thankyou guys for the prompt reply

So, where should I insert those lines?

"Newbie" icon_biggrin.gif  

Hey @ JFrechA - The APF and BDF working fine, detected and banned few icon_wink.gif

su to root
then
crontab -e
then insert the line
then CTRL zz
Catalyst
I prefer an alternative method, since `crontab -e` will sometimes double up the run-parts entries ... Create a file `/etc/cron.d/apacherestart` and drop in your stuff there:
CODE
SHELL=/bin/sh
*/10 * * * * root service httpd restart
theguru
QUOTE (JFrechA)
## Every three days at 6 o'clock p.m.
#crontab -e, and add the line:

0 18 */3 * * /etc/rc.d/init.d/httpd restart


Ah! I'm sorry .. I overlooked ..

Thanx @ texasweb

Catalyst I liked your alternative way, will try it out icon_smile.gif

I'll get an email notification when the cron job runs?
JFrechA
QUOTE (theguru)
Thankyou guys for the prompt reply

So, where should I insert those lines?

"Newbie" icon_biggrin.gif  

Hey @ JFrechA - The APF and BDF working fine, detected and banned few icon_wink.gif


Excellent!, Have a good luck.

As texasweb said, just su - in the shell prompt, and then crontab -e and insert the line there.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.