Subject:Monitor Apache server |
Author:
Richie Posted: 2004-11-28 09:28:51 Apache server could die anytime without your knowledge. In todays world, you must have almost 100% uptime to keep your visitors happy. The idea is to setup a script that checks at a given interval if apache is up, and if not up, restarts it. To do this: 1. Create a script under apache's "bin" directory. Call it check_apache.php Content of check_apache.php: $fp = @fopen("http://localhost/","r"); if (!$fp) { exec("command.com /c start apache.exe -k stop"); exec("command.com /c start apache.exe -k start"); } ?> The code is a simple script that tries to connect to your server. If it cannot connect, it means apache is not running. 2. Once you've saved the code above, you will need a way to run the script using Windows. The last thing you must do is create a Windows scheduled task to run check_apache.php periodically. Start all programs accessories system tools scheduled tasks add scheduled task Create a scheduled task that runs check_apache.bat every few minutes, or every hour depending on your needs. C:phpphp.exe "c:apachebincheck_apache.php" The above needs explanation. First, find the location of php.exe and adjust it in the path above. Also, find the location of your apache bin directory and adjust it in the path above. Now with the correct command, copy and paste it into the Run window of your scheduled task. See an example in the image below: ![]() |
September 25, 2023 |
Subject | Author | Date |
XP Error | Rik | (2010-07-22 15:16:39) |
HIdden / invisible folders | Rik | (2010-04-21 17:20:12) |
Open office margins | Oo default margins | (2008-12-28 13:34:29) |
Synaptic Package Manager disappeared | Rik | (2008-12-28 13:00:14) |
Add to sendTo folder | Rik | (2008-10-28 17:55:47) |
IE: always allow blocked content | Rik | (2008-10-24 14:27:29) |
Inserting an index entry into index $0 of file 25 | Rik | (2008-10-08 11:01:59) |
IE 7 runonce page | Rik | (2008-09-04 13:00:01) |
How to disable ctfmon | Rik | (2008-06-02 14:18:43) |
Windows XP Shut Down and Automatic Reboot Problems | Rik | (2008-05-09 09:17:08) |
How to disable dumprep.exe (Dump Reporting Tool) o | rik | (2008-05-09 09:01:24) |
create wmv playlist | Rik | (2007-07-15 15:59:42) |
create wmv playlist | Rik | (2007-07-15 15:58:21) |
Form Input Field Sizes are not working correctly? | Rik | (2007-04-10 10:18:06) |
Losing Wireless connection | Rik | (2007-03-25 09:17:29) |
dde server window not responding | Rik | (2007-03-17 22:25:48) |
clear address bar history | Rik | (2007-02-08 12:57:12) |
open Service port on xp | Richie | (2004-12-24 13:43:09) |
Monitor Apache server | Richie | (2004-11-28 09:28:51) |
HOW CAN I DISABLE APPS FROM RUNNING AT START-UP? | Richie | (2004-10-31 09:46:33) |
MySQL export options | Richie | (2004-10-30 20:24:25) |
How do I restart apache on linux | Richie | (2004-07-09 12:06:50) |
RAM test... | Richie | (2004-06-24 15:23:03) |
Computer shutdown soon after bootup | Richie | (2004-06-05 08:36:22) |
How to get a list of search terms in search field | Richie | (2004-06-05 08:09:34) |
Recover data from formatted drive | Richie | (2004-06-05 08:03:52) |
Changing the default folder of Windows Explorer | Richie | (2004-05-16 21:28:02) |
How to disable popups on some sites | Richie | (2004-05-03 11:41:45) |
How to disable popups on some sites | Richie | (2004-05-03 10:13:49) |
RE: Windows system directory | Richie | (2004-04-30 11:35:26) |
Windows system directory | Richie | (2004-04-30 11:34:05) |
RE: DIV vs SPAN | Richie | (2004-04-13 12:57:01) |
DIV vs SPAN | Richie | (2004-04-13 12:53:54) |
RE: image coming up as .bmp | Richie | (2004-02-04 09:08:37) |
image coming up as .bmp | Richie | (2004-02-04 09:04:50) |
Auto close DOS window | Richard | (2003-04-25 02:59:19) |
RE: Yahoo Messenger Message from URL | Richard | (2002-10-12 17:17:03) |
Yahoo Messenger Message from URL | Richard | (2002-10-12 17:12:09) |
Printing only a part of a webpage | Richard | (2002-06-01 12:05:14) |
INCREASE SCROLLBAR SIZE | Richard | (2002-05-21 02:46:14) |
PC Technicians' Troubleshooting Resource | Richard | (2002-04-16 06:14:09) |
How to Use DirectX to chat... | Richard | (2002-04-16 03:11:31) |
RE: A Required .DLL File, PNCRT.DLL, Was Not Found | Richard | (2002-04-16 01:23:39) |
A Required .DLL File, PNCRT.DLL, Was Not Found | Richard | (2002-04-16 01:11:41) |
Restore your REGISTRY manually... | Richard | (2002-04-14 19:10:45) |
Computer stops at verifying dmi pool... | Richard | (2002-04-14 10:28:38) |
Low Level formatting / MBR | Richard | (2002-04-12 02:10:56) |
Unix File Permissions | Richard | (2002-04-11 16:26:48) |
FIREWIRE: what does it mean? | Richard | (2002-03-22 00:03:20) |
How to make a CD autorun | Richard | (2002-03-06 01:46:05) |
Speed Up Dialup Logon Time | richie | (2002-01-07 06:23:05) |
Re: IRQ conflict - sharing | Richard | (2002-01-05 08:37:14) |
IRQ conflict - sharing | Richard | (2002-01-05 08:35:39) |
RE:Uninstalling Windows 2000 | richard | (2002-01-05 07:59:58) |
Uninstalling Windows 2000 | richard | (2002-01-05 07:49:33) |
Re: Can't save password in Dial-Up-Networking | Richard | (2001-12-29 15:51:48) |
Can't save password in Dial-Up-Networking | Richard | (2001-12-29 15:49:41) |
Preventing a Document From Being Cached | jr | (2001-12-16 07:14:14) |
How can I quickly see my system resources? | Richard | (2001-10-16 18:40:21) |
Re: Terabytes | Richard Akindele | (2001-10-16 11:24:57) |
Re: Terabytes | Richard Akindele | (2001-10-16 11:24:57) |
Re: Terabytes | Richard Akindele | (2001-10-16 01:11:42) |
Are there larger numbers beyond Terabytes? | J. Vaneer | (2001-10-16 01:02:32) |
What is DMA, and how do I use it? | Rik Kloet | (2001-10-15 14:23:22) |
How do I reallocate resources to eliminate conflic | Richard | (2001-10-01 03:57:04) |
HP Pavilion - PC SETTING CORRECT?... | Vern | (2001-10-01 00:29:44) |
What does AT mean as in modem commands | Richard | (2001-09-30 08:01:22) |
Fast R/W Turn around | Richard | (2001-09-23 06:02:09) |
Should I enable "System and video BIOS Cacheable" | Richard | (2001-09-23 06:00:59) |
WIN2K SPONTANEOUS REBOOT FIX | Richard | (2001-09-23 05:57:02) |
Quick Windows Restart | Richard | (2001-09-23 04:19:08) |
Re: Invalid page fault in msls31.dll | Richard | (2001-08-24 18:11:29) |
Invalid page fault in msls31.dll | Richard | (2001-08-24 17:55:07) |
Re: My ISP disconnects me often. How to prevent t | Richard Akindele | (2001-08-21 11:49:30) |
My ISP disconnects me often. How to prevent this. | Richard Akindele | (2001-08-21 11:47:25) |
Re: How do I turn off this terrible modem noise... | Richard Akindele | (2001-08-21 11:45:04) |
How do I turn off this terrible modem noise...? | Richard Akindele | (2001-08-21 11:40:13) |
Test Msg | Richard Akindele | (2001-08-21 11:32:52) |