每个<directory>都可以单独指定DirectoryIndex
如下:
<directory "path1">
...
DirectoryIndex index.htm
</directory>
<directory "path2">
...
DirectoryIndex default.php
</directory>
......
2、添加alias,使用不同目录
Alias /files "/backup/files"
<Directory "/backup/www">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
3、对Apache特定目录加身份验证
生成身份验证文件:
/usr/local/apache/bin/htpasswd -cm /etc/httpd/auth
<Directory "/backup/www">
Options Indexes MultiViews
AllowOverride None
AuthType Basic
AuthName "www"
AuthUserFile "/etc/httpd/auth"
Require valid-user
</Directory>
声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。