Apache 目录权限

目录访问权限

输入用户名、密码后方可访问home目录下的文件:

httpd.conf

<Directory "D:/software/wwwroot/home">
Options -Indexes MultiViews #-Indexes 禁止目录索引
AllowOverride AuthConfig
Order Deny,Allow
Allow from all
Options All
AllowOverride All

在home目录下放置.htaccess文件

.htaccess

authtype basic
authname "Please input the invitation code" #输入框提示信息
authuserfile D:/software/wwwroot/home/.htpasswd #指定用户名、密码文件存放位置
require valid-user

posted on 2015-02-05 15:44  TroyZ  阅读(295)  评论(0)    收藏  举报