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.
NameVirtualHost 127.0.0.1:8082
<VirtualHost 127.0.0.1:8082>
ServerName tools.sitename.ru
RPAFenable On
RPAFsethostname Off
RPAFproxy_ips 127.0.0.1
# 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>
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from all
</Location>
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
Best Answer
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:
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.