我有一个Apache的httpd设置,我试图只允许从DocumentRoot文件夹的HTML和ico文件。 然而,我发现与我已经粘贴在下面的configuration,如果我使用URL app1.example.com说,“你没有权限访问/此服务器上的Apache的Apache给了我一个403。 但是,如果我键入app1.example.com/index.html我得到预期的页面。 我认为索引的覆盖会涵盖这一点,但似乎并不是这样。
在我的httpd.conf中,我有默认的拒绝:
# Deny access to the entirety of your server's filesystem. You must # explicitly permit access to web content directories in other # <Directory> blocks below. #Default <Directory /> AllowOverride none Require all denied </Directory>
那么对于我的虚拟主机条目,我有:
<VirtualHost *:443> ServerName app1.example.com <Directory /> <FilesMatch ".+\.(html|ico)$"> Require all granted </FilesMatch> DirectoryIndex index.html AllowOverride Indexes </Directory> DocumentRoot D:\MyApp1 Alias /app1 D:\MyApp1 JkMount /app1/* worker10