|
|
我装了apache的2.0.55,作了一个虚拟主机.想对这个虚拟主机只有合法用户才能访问,而默认的主页可疑随便访问,要怎么做?
我的配置文件如下:
<VirtualHost *:80>
DocumentRoot /usr/apache/test
ServerName lzy.mark.com
Alias / "/usr/apache/test"
<Directory /usr/apache/test>
Options FollowSymLinks Indexes
AllowOverride AuthConfig
Order allow,deny
allow from all
</Directory>
ErrorLog logs/lzy-error_log
CustomLog logs/lzy-access_log common
</VirtualHost>
.htaccess文件如下:
authName " lease Enter You Name and Password"
authType Basic
authuserfile /usr/apache/conf/password
require valid-user
这样以后,在 本机测试,虚拟主机仍然不提示输入用户和密码对能访问...
然而把上面的 Alias / "/usr/apache/test" 改为 Alias /test "/usr/apache/test/test"
(我在test的目录下还有一个 test目录) ,之后在访问这个虚拟机的时候,http://192.168.1.111/test ,只有这样的时候才能实现..
我想在默认的 时候:http://192.168.1.111 这样访问的时候要密码,请问要怎么做? |
|