t****r 发帖数: 106 | |
g**a 发帖数: 6 | 2 什么系统?【 在 tansir (HappyLife) 的大作中提到: 】 |
t****r 发帖数: 106 | 3 UNIX下(web),我看不少就是用.htaccess 和 .htpasswd好像就行了
,不过试了试没成功。不知应该怎么用?请指教
【在 g**a 的大作中提到】 : 什么系统?【 在 tansir (HappyLife) 的大作中提到: 】
|
m*****e 发帖数: 4193 | 4 Sometimes you need to change the apache configuration, especially
the AllowOverride directive. If it's set to None then probably
you won't be able to use .htaccess. Check the apache FAQ online.
【在 t****r 的大作中提到】 : UNIX下(web),我看不少就是用.htaccess 和 .htpasswd好像就行了 : ,不过试了试没成功。不知应该怎么用?请指教
|
m****k 发帖数: 51 | 5 Microbe is right. Besides that you need to put a .htaccess file
in the directory you want to protect. here is a example of .htaccess:
AuthName "Protected Directory"
AuthType Basic
AuthUserFile /usr/local/apache/conf/htpasswd.users
require valid-user
And you need to use htpasswd to create the password file
/usr/local/apache/conf/htpasswd.users which contain the users and passwords.
【在 m*****e 的大作中提到】 : Sometimes you need to change the apache configuration, especially : the AllowOverride directive. If it's set to None then probably : you won't be able to use .htaccess. Check the apache FAQ online.
|