DevHeads.net

A curious thing - apachectl status in Apache 2.4.25

I recently built Apache 2.4.25 and am running it on RHEL 7.3.
I've found something that seems a step backwards from 2.4.6
and I'm hoping someone can shed some light on it.

In the Apache 2.4.6 shell script apachectl, a call to "apachectl status"
invokes systemctl status httpd.service. This gives you easy-to-read
output regardless if the server is running or not.

In the Apache 2.4.25 version of apachectl, "apachectl status" instead
calls links with the /server-status URL. When the server is up, you
get a lot of info. When the server is down, you get a Elinks error,
which is a little ambiguous, as there could be other reasons for
links not working correctly.

Doesn't this seem like a step backwards?

Can someone explain the rationale for this?

(Please note: I can fix this, but I'm curious as to why it was done this way)

Thanks,

Jeff Cauhape
IT Professional III
Department of Employment, Training and Rehabilitation
Phone 1-775-684-3804
Email: <a href="mailto: ... at nvdetr dot org"> ... at nvdetr dot org</a>

Comments

Re: A curious thing - apachectl status in Apache 2

By Eric Covener at 05/15/2017 - 13:24

On Mon, May 15, 2017 at 1:22 PM, Jeff Cauhape < ... at nvdetr dot org> wrote:
Did you go from a vendor package to a source install? The former
probably just customized apachectl.

RE: A curious thing - apachectl status in Apache 2

By Jeff Cauhape at 05/15/2017 - 16:21

Eric,

Yes, I went from 2.4.6 bundled with Red Hat to a plain source code build.
It didn't occur to me that it might be that simple. Thanks! :o

Mgmt has decided that they want the ability to easily have multiple versions
of Apache on our servers and to be able to switch from one build to another by
having symbolic links that are generic that point to the active directory. Somewhat
like the way Java does.

I just added a couple of lines of shell script following the links command after
the 'status' command line switch. It checks for the number of httpd processes,
and if there are none, it echoes "It's DEAD, Jim!". Otherwise It echoes "It's ALIVE!!!".

That seems pretty clear.

Jeff

On Mon, May 15, 2017 at 1:22 PM, Jeff Cauhape < ... at nvdetr dot org> wrote:
Did you go from a vendor package to a source install? The former probably just customized apachectl.

RE: A curious thing - apachectl status in Apache 2

By Houser, Rick at 05/15/2017 - 16:54

Isn't that just going to give bad results, though? For example, if you had issued apachectl stop, there would still be processes handling the graceful stop, but your script would say it's alive.

Rick Houser
Web Administration

RE: A curious thing - apachectl status in Apache 2

By Jeff Cauhape at 05/15/2017 - 18:49

Rick,

That could be, except that if I just gave the stop command and it's "still" running
it doesn't nearly concern me as much as getting an Elinks error and wondering
if it's because it isn't running or whether there is some other issue.

Besides, this It's DEAD/ALIVE message comes _ after _ the call to links to output
status, so if there are still running processes from a graceful shutdown, the output
just above it should make that clear. This does not replace the call to links, but is
in addition to it.

I could probably take out the "It's ALIVE" message and achieve my goals, but I've
always been a fan of sci-fi and this just seemed too good to pass up. :)

Jeff

Isn't that just going to give bad results, though? For example, if you had issued apachectl stop, there would still be processes handling the graceful stop, but your script would say it's alive.

Rick Houser
Web Administration

B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB  [ X ܚX KK[XZ[
\ \ ][ X ܚX P
\X K ܙ B ܈Y][ۘ[ [X[  K[XZ[
\ \ Z[
\X K ܙ B