nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

how to restart apache when die.

This is a discussion on how to restart apache when die. within the CentOS / RHEL / Fedora forums, part of the Linux Distribution category; please help me create a shell script auto restart apache when it die. and auto reboot server at 6h AM ...


Go Back   nixCraft Linux Forum > Linux Distribution > CentOS / RHEL / Fedora

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 05-12-2008, 01:20 AM
Junior Member
User
 
Join Date: May 2008
My distro: Debian
Posts: 1
Rep Power: 0
LifeTimes is on a distinguished road
Default how to restart apache when die.

please help me create a shell script auto restart apache when it die.
and auto reboot server at 6h AM daily !

Thank you read and help me !

Info My server .

OS : fedora
CPL : plesk 8.3
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-12-2008, 04:08 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 910
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

You need to use a tool called monit

Monitor and restart Apache or lighttpd webserver when daemon is killed
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #3 (permalink)  
Old 05-13-2008, 06:03 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 910
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default Shell Script to auto restart apache when it goes down

Oh here is a script from my old box:
Code:
#!/bin/bash
#
# Restart Apache IF died
#
tCounter=$(pgrep httpd | wc -l)
if [ $tCounter -le 0 ]
then
 service httpd start
fi
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
solaris restart sshd Solaris/OpenSolaris 2 01-20-2007 08:18 AM
Linux command to restart apache chiku Linux software 2 12-13-2006 06:59 PM
solaris inetd restart Solaris/OpenSolaris 1 01-18-2006 08:29 PM
freebsd syslogd restart All about FreeBSD/OpenBSD/NetBSD 1 12-30-2005 12:41 AM
restart the ssh service goku1 Linux software 1 12-22-2005 11:19 PM


All times are GMT +5.5. The time now is 12:35 PM.


Powered by vBulletin® Version 3.7.2 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36