Results 1 to 10 of 16
Threaded View
-
17th May 2011, 01:51 PM #1OPMemberWebsite's:
satiq.netCheck if Apache is ON
Hi, I'm looking for a script to put on crontab that check if my domain is on, otherway it restart apache.
Sometimes my apache get freeze and I need to manually restart it.
I found many scripts that check if httpd is running, but in my case apache is working but none can connect to it.
How can I check if it's working and I can connect to my web pages?
My actually code is:
Code:#!/bin/bash # Apache Process Monitor # Restart Apache Web Server When It Goes Down # ------------------------------------------------------------------------- # Copyright (c) 2003 nixCraft project <http://cyberciti.biz/fb/> # This script is licensed under GNU GPL version 2.0 or above # ------------------------------------------------------------------------- # This script is part of nixCraft shell script http://en.wikipedia.org/wiki/Shell_script collection (NSSC) # Visit http://bash.cyberciti.biz/ for more information. # ------------------------------------------------------------------------- # RHEL / CentOS / Fedora http://en.wikipedia.org/wiki/Fedora Linux restart command RESTART="/sbin/service httpd restart" # uncomment if you are using Debian / Ubuntu Linux #RESTART="/etc/init.d/apache2 restart" #path to pgrep command PGREP="/usr/bin/pgrep" # Httpd daemon name, # Under RHEL/CentOS/Fedora it is httpd # Under Debian 4.x it is apache2 HTTPD="httpd" # find httpd pid $PGREP ${HTTPD} if [ $? -ne 0 ] # if apache not running then # restart apache $RESTART fi
skinner Reviewed by skinner on . Check if Apache is ON Hi, I'm looking for a script to put on crontab that check if my domain is on, otherway it restart apache. Sometimes my apache get freeze and I need to manually restart it. I found many scripts that check if httpd is running, but in my case apache is working but none can connect to it. How can I check if it's working and I can connect to my web pages? My actually code is: Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Apache 2.2.X or 2.4.X
By comeback in forum Hosting DiscussionReplies: 3Last Post: 4th Oct 2012, 11:43 AM -
Do you know How to Check LiteSpeed Apache ?
By ronimmi in forum Hosting DiscussionReplies: 5Last Post: 28th Jun 2012, 04:00 AM -
How to Upgrade Apache 2.2.3 to 2.2.21 ?
By feronso in forum Server ManagementReplies: 8Last Post: 17th Dec 2011, 08:44 AM -
php/apache help
By HixxoHosting in forum Web Development AreaReplies: 2Last Post: 28th Apr 2011, 05:00 PM -
Install Apache and PHP
By VAHID in forum Server ManagementReplies: 3Last Post: 10th Jan 2011, 08:46 AM
themaPoster - post to forums and...
Version 5.35 released. Open older version (or...