VirtualHost中的位置指令

我试图在我的虚拟主机之一添加服务器状态位置指令,但是当浏览到www.mywebsite.com/server-status时,我得到一个403访问禁止。 将位置指令置于虚拟主机下是否合法?

编辑#1:完整的虚拟主机configuration

<VirtualHost *:80> # Admin email, Server Name (domain name) and any aliases ServerAdmin [email protected] ServerName aumento.io ServerAlias www.aumento.io # Index file and Document Root (where the public files are located) DirectoryIndex index.html index.php DocumentRoot /home/cairocubicles/web/aumento.io/public <Directory /home/cairocubicles/web/aumento.io/public> Order Allow,Deny Allow from all Options Indexes FollowSymLinks AllowOverride All AcceptPathInfo On </Directory> <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from aumento.io </Location> # Custom log file locations LogLevel warn ErrorLog /home/cairocubicles/web/aumento.io/log/error.log </VirtualHost> 

是的,该文档指出,可以在服务器和虚拟主机上下文中使用位置。

检查底层文件系统以确保Web服务器具有访问文件和目录的适当权限。


您的更新显示您只允许aumento.io访问。 确保aumento.io的IP地址parsing为您正在连接的计算机的地址。 如果是这样,Web服务器与aumento.io在同一台机器上,那么你应该检查日志,看看Apache认为你连接的IP地址,并将其添加到列表(你很可能通过回送接口连接)例如

 Allow From aumento.io 127.0.0.1