Detect apache state and restart?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Detect apache state and restart?

Postby pcs800 » 26. December 2011 15:29

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?
pcs800
 
Posts: 33
Joined: 22. September 2005 15:08

Re: Detect apache state and restart?

Postby JonB » 26. December 2011 16:38

Are you running XAMPP or a standalone Apache install???

8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Detect apache state and restart?

Postby pcs800 » 26. December 2011 16:50

xampp
pcs800
 
Posts: 33
Joined: 22. September 2005 15:08

Re: Detect apache state and restart?

Postby JonB » 26. December 2011 21:27

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
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Detect apache state and restart?

Postby pcs800 » 26. December 2011 21:35

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?
pcs800
 
Posts: 33
Joined: 22. September 2005 15:08

Re: Detect apache state and restart?

Postby JonB » 26. December 2011 21:50

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
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 33 guests