I'm configuring server-status and get 404 error. I need allow access to server-status only from site subdomain on same IP. I put server-status location to virtualhost config, but it's not working.

If I put location into httpd.conf, server-status works on all subdomains.

    ServerName tools.sitename.ru
    RPAFenable On
    RPAFsethostname Off
    #    RPAFheader X-Real-IP
#    AllowOverride All
    DocumentRoot /var/www/tools.sitename

    DirectoryIndex index.php index.html default.asp index.cgi
    ErrorLog /var/log/httpd/tools.sitename.error.log
    CustomLog /var/log/httpd/tools.sitename.access.log common

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

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

    <Directory />
        Options FollowSymLinks
        AllowOverride All

migrated from webmasters.stackexchange.com Jan 11 '14 at 11:52

This question came from our site for pro webmasters.


Ah yes - dont I remember my hair-pulling sessions when I encountered this a while back then. Use double quote when identifying <location />

For example - in my apache2 virtual hosting, similar setup as yours:

 <Location "/">
            Order Deny,Allow
            Deny from all
            Allow from all

I noticed that double quote marks is used for but not others as needed. But, that's how I beat Apache to get working. EDIT: After checking, it appears that I also used double quote marks for <directory "/var/www"> as well. Strangely enough, but, that's how I get Apache to work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy