Page 1 of 1

Detect apache state and restart?

PostPosted: 26. December 2011 15:29
by pcs800
My companies server runs apache on a windows 2003 server, last night apache stopped and we didn't notice for a few hours. Is there a script or something i can run to detect if apache stops and restart it automatically if it does?

Re: Detect apache state and restart?

PostPosted: 26. December 2011 16:38
by JonB
Are you running XAMPP or a standalone Apache install???

8)

Re: Detect apache state and restart?

PostPosted: 26. December 2011 16:50
by pcs800
xampp

Re: Detect apache state and restart?

PostPosted: 26. December 2011 21:27
by JonB
A. - it would probably be useful to know what version of XAMPP you are running - You might even put it in your profile along with the OS version as requested when you signed up.

B. - Are you running Apache as a service?

C. - Apache shouldn't have just 'stopped' - there was likely an error condition that caused this - what's in the error log??? Resovling that issue is probably the key. Normally on Windows, when Apache 'dies', its a 'worker process/child' that is killed off, and the MPM kickstarts a new worker process. (that's why there are two httpd processes)

Good Luck
8)









ycf

Re: Detect apache state and restart?

PostPosted: 26. December 2011 21:35
by pcs800
Well, setting xampp aside for a moment, I would like to simply restart apache service (yes it runs as a service). Windows evnet viewer just informas of the error, doesn't say why.
What log am I looking in to find out why it stopped?

Re: Detect apache state and restart?

PostPosted: 26. December 2011 21:50
by JonB
A. you can't actually 'set xampp aside' in this case (and that was the reason for my original question), as Apache restarts are specific to the threading model. Some restart versions (syntax) only work on Unix derivatives.

B - Error log -> \xampp\apache\logs\error.log

Good Luck