Configuring Apache 2.4 mod_status with virtual hosts Getting a forbidden error

I am trying to configure mod_status on my apache 2.4 server. I spent a network for several hours, but all the examples just show the tags in the main httpd.conf file, and not how to place the directives in the virtual host setup.

This is my virtual host configuration with what I tried. When I do this, and then open the local browser or browser from my allowed IP address (my remote public address), I get a forbidden error in the browser.

<VirtualHost *:80> ServerName www.thevmscloud.com ServerAlias thevmscloud.com ServerAdmin admin@thevmscloud.com DocumentRoot "d:/wamp/webdocs/www/" ErrorLog "logs/www.thevmscloud.com.log" CustomLog "logs/www.thevmscloud.com.log" common <Location /server-status> SetHandler server-status Order deny,allow Deny from all Require host 127.0.0.1 81.133.136.16 </Location> <Directory "d:/wamp/webdocs/www/"> LogLevel crit Options Indexes FollowSymLinks Includes ExecCGI AllowOverride all Order Allow,Deny Allow from all Require all granted </Directory> 

I tried all kinds of combinations of settings commented to / from, the location block with the virtual host block, outside it, in the main body of httpd.conf and still is not happy.

The problem is that I just cannot find an example of this setting anywhere. Some posts say you can add this to your virtual host configuration, but then don't show how to do it.

Does anyone know how to configure this so that I can go to my .com / server-status domain and see server statistics, as expected?

Thanks a lot Mark

+4
source share
2 answers

Change it like this:

 <Location /server-status> SetHandler server-status Require ip 127.0.0.1 Require ip ::1 Require ip 81.133.136.16 </Location> 
  • Do not use require "host" if you do not need it, because it will try to solve it (especially for localhost).
  • Also check the error logs.
  • :: 1 is localhost for IPv6, maybe you need it.
+6
source

to access the server state by the name of the virtual host, and not by localhost / 127.0.0.1 , check out my configuration:

 <IfModule mod_status.c> <Location /server-status> SetHandler server-status Order deny,allow Allow from 127.0.0.1 Allow from ::1 </Location> </IfModule> 

Allow from the address of the client located on the same host, and not the address at which you call the server, since different virtual mailboxes with different server addresses share the same computer on the local host.

since I have only one virtual mailbox, I don’t know yet whether the returned data will be divided into different virtual mailboxes. if you know this, edit this post or leave a comment.

note that when trying to access http (s): // hostname / server-status from another address, a failure occurred with status 403, and a mysterious message was displayed in the log: AH01797: the client was rejected due to the server configuration . in the end, I could not get access to the status from the outside, even when I allowed everyone to allow it , but for me it was not so important.

hope this helps

0
source

Source: https://habr.com/ru/post/1491700/


All Articles