Activity Stream
48,167 MEMBERS
6876 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1.     
    #1
    Member
    Website's:
    satiq.net

    Default 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:

    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
    Thanks...
    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

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    felonygames.com
    Why is Apache freezing on your server? This seems more like a duct tape fix. I would consider seeing what is causing your apache to stop responding, so you can render this method obsolete..

  4.     
    #3
    Banned
    Website's:
    KWWHunction.com
    You can use the script my friend coded here http://static.webden.org/

  5.     
    #4
    Member
    Website's:
    Elite.SO Defendos.com Motionite.com
    Quote Originally Posted by DLow View Post
    You can use the script my friend coded here http://static.webden.org/
    -1

    Didn't expected that from you.

    Defendos BETA3 Released! Thread - Official Website

  6.     
    #5
    Member
    Website's:
    satiq.net
    None can comments the pic that I posted?

  7.     
    #6
    Member
    Website's:
    ultratechhost.com
    the script used by DLow is an open source script which can be found at: http://www.serviceuptime.com/psc/index.php

    Direct Link to the script

    Code: 
    http://www.serviceuptime.com/downloads/phpSiteCheck.zip

  8.     
    #7
    Member
    Website's:
    satiq.net
    How can I check? In error log I don't see any specific error..

    For example, I had just 1 hour downtime but it's gone online by itself.. I didn't restart apache..

  9.     
    #8
    It begins...
    Does your site stream or offer files for download?

  10.     
    #9
    Member
    Website's:
    satiq.net
    No, only 1 blog and 1 forum...

  11.     
    #10
    It begins...
    What you describe sounds more like your server/cpu gets tied up on a process to the point where it cannot serve httpd processes; thus the temporary downtime/freeze.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Apache 2.2.X or 2.4.X
    By comeback in forum Hosting Discussion
    Replies: 3
    Last Post: 4th Oct 2012, 11:43 AM
  2. Do you know How to Check LiteSpeed Apache ?
    By ronimmi in forum Hosting Discussion
    Replies: 5
    Last Post: 28th Jun 2012, 04:00 AM
  3. How to Upgrade Apache 2.2.3 to 2.2.21 ?
    By feronso in forum Server Management
    Replies: 8
    Last Post: 17th Dec 2011, 08:44 AM
  4. php/apache help
    By HixxoHosting in forum Web Development Area
    Replies: 2
    Last Post: 28th Apr 2011, 05:00 PM
  5. Install Apache and PHP
    By VAHID in forum Server Management
    Replies: 3
    Last Post: 10th Jan 2011, 08:46 AM

Tags for this Thread

BE SOCIAL