4

We have an Apache server configured such that in conf/httpd.conf we have (the rest of the file has been removed for brevity):

LoadModule status_module modules/mod_status.so
ExtendedStatus On

And in conf.d/myserver.conf we have (other bits removed again):

Listen 8162
<VirtualHost *:8162>

<Location /server-status>
    SetHandler server-status
    Order allow,deny
    Allow from localhost
    Deny from all
</Location>

</VirtualHost>

Note that in httpd.conf, all Listen directives are commented out, meaning that Apache is only listening on port 8162. <Location /server-status> is also commented out in httpd.conf.

We get a 403 when we try:

wget http://localhost:8162/server-status

Can server-status run on a non-standard port? If it can, what else should we be looking for in order to make server-status accessible from the localhost?

2 Answers 2

11

this worked for me, when using varnish on port 80, serving apache from port 8000 with an additional apache Listen on port 8001 defined in

/etc/apache2/mods-enabled/status.conf

.

<IfModule mod_status.c>
#
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Uncomment and change the ".example.com" to allow
# access from other hosts.
#

Listen 8001
ExtendedStatus On
<VirtualHost *:8001>
    <Location /server-status>
        SetHandler server-status
        Order deny,allow
        Deny from all
        Allow from localhost ip6-localhost 
    #    Allow from .example.com
    </Location>
</VirtualHost>
</IfModule>

you can test it with lynx

lynx -dump http://127.0.0.1:8001/server-status

the lynx output should look like something like this: ~

                       Apache Server Status for 127.0.0.1

   Server Version: Apache/2.2.14 (Ubuntu) mod_ssl/2.2.14 OpenSSL/0.9.8k
   Server Built: Nov 3 2011 03:29:23
     __________________________________________________________________

   Current Time: Saturday, 03-Dec-2011 12:36:05 CET
   Restart Time: Friday, 02-Dec-2011 00:59:04 CET
   Parent Server Generation: 22
   Server uptime: 1 day 11 hours 37 minutes
   Total accesses: 44550 - Total Traffic: 368.1 MB
   CPU Usage: u27.53 s3.48 cu0 cs0 - .0242% CPU load
   .347 requests/sec - 3010 B/second - 8.5 kB/request
   2 requests currently being processed, 4 idle workers

W___._W.........................................................

--cut--
2
  • Heads up! It is important for ExtendedStatus to be outside the VirtualHost declaration. Apache won't like it within.
    – flickerfly
    Apr 25, 2014 at 19:28
  • I have ExtendedStatus set to On, in mode and /etc/apache2/apache.conf and on the server with http port 80 sites-available/000-default.conf got it working on the same host using lynx but on a differnt host running apache2 with https redirect and ssl same setup does nt seem to work Aug 25, 2020 at 22:39
2

It was a privs issue:

http://publib.boulder.ibm.com/httpserv/ihsdiag/questions.html#servstatforbidden

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .