You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Graves, Jan" <Ja...@lisd.us> on 2006/07/06 16:16:18 UTC

[users@httpd] How to tell if Apache is really running

First I have to apologize to all of you Apache experts for what will sound like a stupid question.  However, I am new to Apache and will admit that I have not a clue what I am doing with it.  How can I tell if Apache is really running, since now matter what I cannot access the web site this server should be hosting?

This command    ps -ax |grep http          produces the following results:
 1029  ??  Ss     0:00.46 /usr/local/sbin/httpd
 1030  ??  I      0:00.00 /usr/local/sbin/httpd
 1031  ??  I      0:00.00 /usr/local/sbin/httpd
 1032  ??  I      0:00.00 /usr/local/sbin/httpd
 1033  ??  I      0:00.00 /usr/local/sbin/httpd


I am running Apache Version 1.3 on a Unix system.  Things were running fine until storms took out the power over the week-end and the system needed to be re-started.  This system was set up by a third party company who no longer provides support.  So, I am trying to determine what the problem is.  The Unix system itself starts and all of the processes that I expect, except Apache.  

I have attached the error log file.  If anyone needs further information, please let me know.  I will try to find it.  In looking at the Apache site, I know that things were not left in default places.


Thanks in advance for any suggestions.

 
Jan Graves
Network Administrator/Engineer
Lenawee Intermediate School District
4107 N. Adrian Highway
Adrian, MI 49221
Phone: 517-265-1634
Fax:     517-265-7405
Visit us on the web at http://lisd.k12.mi.us
 


RE: [users@httpd] How to tell if Apache is really running

Posted by Cesar Jorge Martinez Mata <cj...@hi-iberia.es>.
Hi Jan,

Its easy...
You can use the web browser text tool called curl:
http://curl.haxx.se/download.html

And a example of launch:
if curl -m $TIMEOUT_PETICION_WEB
"http://$HOST_INTRANET:$PUERTO_WEB_GAM_INTRANET" 2>&1 | grep
-i \<\/html\> > /dev/null
then
   echo "Arrancado..."
else
   # Indeterminado o no responde
   echo "Parado..."
fi

The timeout can be 2 (seconds)
If you need to check also ldap: change http to ldap
If you need to check web + ldap and, by example, a engine servlet:
"http://$ADMIN_LDAP_WEB_GAM:$CLAVE_ADMIN_LDAP_WEB_GAM@$HOST_I
NTRANET:$PUERTO_WEB_GAM_INTRANET/caucho_status"

You can to probe also a db pool, creating a jsp page with a simple
connection sql form, and calling it...

My question is I would like to know the objective of this processes at
Apache 2.2.2:
   infra 24269 24247  /app/apache-2.2.2/bin/httpd -k start
   infra 25115 24247  /app/apache-2.2.2/bin/httpd -k start
   infra 24270 24247  /app/apache-2.2.2/bin/httpd -k start
   infra 24268 24247  /app/apache-2.2.2/bin/httpd -k start
   infra 25098 24247  /app/apache-2.2.2/bin/httpd -k start
   infra 24266 24247  /app/apache-2.2.2/bin/httpd -k start
   infra 24247     1  /app/apache-2.2.2/bin/httpd -k start
   infra 24267 24247  /app/apache-2.2.2/bin/httpd -k start

Process 24269, 25115, etc... childrens of 24247


Cesar Jorge


-----Mensaje original-----
De: Graves, Jan [mailto:Jan.Graves@lisd.us] 
Enviado el: jueves, 06 de julio de 2006 16:16
Para: users@httpd.apache.org
Asunto: [users@httpd] How to tell if Apache is really running

First I have to apologize to all of you Apache experts for what will sound
like a stupid question.  However, I am new to Apache and will admit that I
have not a clue what I am doing with it.  How can I tell if Apache is really
running, since now matter what I cannot access the web site this server
should be hosting?

This command    ps -ax |grep http          produces the following results:
 1029  ??  Ss     0:00.46 /usr/local/sbin/httpd
 1030  ??  I      0:00.00 /usr/local/sbin/httpd
 1031  ??  I      0:00.00 /usr/local/sbin/httpd
 1032  ??  I      0:00.00 /usr/local/sbin/httpd
 1033  ??  I      0:00.00 /usr/local/sbin/httpd


I am running Apache Version 1.3 on a Unix system.  Things were running fine
until storms took out the power over the week-end and the system needed to
be re-started.  This system was set up by a third party company who no
longer provides support.  So, I am trying to determine what the problem is.
The Unix system itself starts and all of the processes that I expect, except
Apache.  

I have attached the error log file.  If anyone needs further information,
please let me know.  I will try to find it.  In looking at the Apache site,
I know that things were not left in default places.


Thanks in advance for any suggestions.

 
Jan Graves
Network Administrator/Engineer
Lenawee Intermediate School District
4107 N. Adrian Highway
Adrian, MI 49221
Phone: 517-265-1634
Fax:     517-265-7405
Visit us on the web at http://lisd.k12.mi.us
 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] How to tell if Apache is really running

Posted by Tony Heal <th...@pace2020.com>.
Since apache does not have a 'status' in it's init script here is one.
Simple copy this into a file and make it executable. This file does assume
you have perl available. If you look closely you can edit this file to
provide status of almost any running process.

******* Begin cut *******
#!/usr/bin/perl

use warnings;
use strict;

printStatus ("Apache", getApacheStatus());

sub printStatus
{
    my( $name, $status ) = @_;

    if( defined $status )
    {
        print "$name is $status\n";
    }
    else
    {
        warn "Unable to determine status of $name : $!\n";
    }
}

sub getServiceStatus
{
    my ($pidfile) = @_;

    if( -f $pidfile )
    {
        open( PIDFILE, $pidfile ) or return undef;
    
        my $pid = <PIDFILE>;
        
        chomp $pid;
        
        close( PIDFILE ) or return undef;

        my $status = `ps -p $pid -o pid=`;
        
        if( $status =~ /$pid/ )
        {
            return "running";
        }
        else
        {
            return "not running (pid exists)";
        }
    }
    else
    {
        return "not running (no pid)";
    }
}              

sub getApacheStatus 
{
    return getServiceStatus( '/var/run/apache.pid' );
}

******* End cut ******* 


 
Tony Heal
Pace Systems Group, Inc.
800-624-5999
theal@pace2020.com
 

-----Original Message-----
From: Graves, Jan [mailto:Jan.Graves@lisd.us] 
Sent: Thursday, July 06, 2006 10:16 AM
To: users@httpd.apache.org
Subject: [users@httpd] How to tell if Apache is really running

First I have to apologize to all of you Apache experts for what will sound
like a stupid question.  However, I am new to Apache and will admit that I
have not a clue what I am doing with it.  How can I tell if Apache is really
running, since now matter what I cannot access the web site this server
should be hosting?

This command    ps -ax |grep http          produces the following results:
 1029  ??  Ss     0:00.46 /usr/local/sbin/httpd
 1030  ??  I      0:00.00 /usr/local/sbin/httpd
 1031  ??  I      0:00.00 /usr/local/sbin/httpd
 1032  ??  I      0:00.00 /usr/local/sbin/httpd
 1033  ??  I      0:00.00 /usr/local/sbin/httpd


I am running Apache Version 1.3 on a Unix system.  Things were running fine
until storms took out the power over the week-end and the system needed to
be re-started.  This system was set up by a third party company who no
longer provides support.  So, I am trying to determine what the problem is.
The Unix system itself starts and all of the processes that I expect, except
Apache.  

I have attached the error log file.  If anyone needs further information,
please let me know.  I will try to find it.  In looking at the Apache site,
I know that things were not left in default places.


Thanks in advance for any suggestions.

 
Jan Graves
Network Administrator/Engineer
Lenawee Intermediate School District
4107 N. Adrian Highway
Adrian, MI 49221
Phone: 517-265-1634
Fax:     517-265-7405
Visit us on the web at http://lisd.k12.mi.us
 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org