我们使用 shibboleth 来保护 apache 虚拟主机。我们希望为该站点公开提供单个文件(站点地图)。
有没有办法在虚拟主机中编写这个代码?
当前的虚拟主机如下所示:
<VirtualHost *:443>
ServerName my-staging.sjf.edu
DocumentRoot /var/www/sjf/my
<Directory "/var/www/sjf/my">
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Location />
AuthType shibboleth
ShibRequestSetting requireSession 1
<RequireAny>
Require env allowed
require shib-session
</RequireAny>
</Location>
...
<VirtualHost *:443>
我想公开的文件最好位于站点根目录中,但如果有必要,也可能位于其他地方。
答案1
<Location>
只需为站点地图添加一个新指令,然后使用以下命令进行配置Require all granted
:
<VirtualHost *:443>
ServerName my-staging.sjf.edu
DocumentRoot /var/www/sjf/my
<Directory "/var/www/sjf/my">
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Location />
AuthType shibboleth
ShibRequestSetting requireSession 1
<RequireAny>
Require env allowed
require shib-session
</RequireAny>
</Location>
<Location /sitemap.xml>
Require all granted
</Location>
<VirtualHost *:443>