Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I enabled the following on httpd.conf:

ExtendedStatus On

LoadModule status_module modules/mod_status.so

and also:


NameVirtualHost *:80

<VirtualHost *:80>
  ServerName myserver.com
  ServerAlias myserver.com 

  DocumentRoot /prod/html

  RewriteEngine on
  RewriteCond %{HTTP_HOST} .*myserver.com$
  RewriteRule /(.*) http://myserver.com/$1 [R,L]





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

</VirtualHost>

when running lynx http://localhost/server-status get the following message: You don't have permission to access /server-status on this server.

I don't see anything related to /server-status in my /etc/httpd folder these are the folders I have under /etc/httpd:

**conf
conf.d
logs -> ../../var/log/httpd
modules -> ../../usr/lib/httpd/modules
run -> ../../var/run**

any idea why I get the "permission denied" error? do I need to install another package for get it? Thanks!! Dotan.

share|improve this question
    
Maybe there is something wrong with VirtualHosts' configuration. It's hard to say without looking at full dump of Apache configuration. Did you restart Apache? Is there anything in ErrorLog? –  0xFF Dec 27 '12 at 19:32
    
This is the error I get: [Thu Dec 27 20:05:17 2012] [error] [client 127.0.0.1] client denied by server configuration: /prod/html/server-status –  edotan Dec 27 '12 at 20:06
    
here is my httpd.conf: –  edotan Dec 27 '12 at 21:42
    
Try adding ServerAlias localhost to this VirtualHost declaration. Try lynx http://myserver.com/server-status. Try temporary disabling mod_rewrite. As @Epaphus suggested try moving server-status declaration outside VirtualHost. Do you have any other VirtualHosts configured? –  0xFF Dec 28 '12 at 6:04
    
I added ServerAlias localhost and disabled the mod_rewrite but still I get [error] [client 127.0.0.1] client denied by server configuration: /prod/html/server-status –  edotan Dec 28 '12 at 18:42
show 2 more comments

2 Answers

up vote 2 down vote accepted

Try it with the IP instead of the host name, This is how mine looks ( ::1 is there as the server also has IPv6 enabled)

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

Using

lynx http://localhost/server-status 

might not be matching the virtual host "myserver.com" so you could try putting the Location /server-status outside of the VirtualHost in the http.conf

share|improve this answer
add comment

Just in case this helps someone:

In newer versions of Apache there is a default server-status config setting in conf/extra/httpd-info.conf which will override any server-status settings in httpd.conf

That default config in conf/extra/httpd-info.conf is set to “Allow from .example.com” and will annihilate all fancy server-status changes you do in httpd.conf

So if you are facing permission issues make sure you are editing the proper file!

share|improve this answer
1  
How new of Apache version? And how do you know that this isn't something peculiar to your distribution (which you forgot to mention)? –  Michael Hampton Aug 27 '13 at 20:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.