apache_Linux_win目录认证 不指定

, 2007/08/14 22:04 , Apache , 评论(0) , 阅读(3996) , Via 本站原创 | |
Linux
1、/www/client/photo
2、vi httpd.conf
<Directory "/www/client/photo">
        Options Indexes MultiViews
        AllowOverride AuthConfig
        Order allow,deny
        Allow from all
</Directory>

3、vi /www/client/photo/.htaccess
AuthName "请输入访问相册的帐号密码:"
AuthType Basic
AuthUserFile /www/client/photo/.htpasswd
require valid-user
4、htpasswd -c /var/www/test/.htpasswd ltsnet
输入密码,ok。
修改密码用:htpasswd -m .htpasswd ltsnet
5、/usr/local/apache/bin/apachectl restart
WIN2000
1、d:\soft
2、vi httpd.conf

<Directory "d:/soft">
  AuthType Basic
  AuthName 请输入访问密码:
  AuthUserFile c:/Apache2/user
  require valid-user
  Order allow,deny
  Allow from all
  #下面为目录列表
  Options Indexes MultiViews
  IndexOptions FancyIndexing ScanHTMLTitles NameWidth=128 DescriptionWidth=256 HTMLTable VersionSort FoldersFirst
  IndexOrderDefault Ascending Date
</Directory>

3、c:\Apache2\bin>htpasswd.exe -c c:\\apache2\\user ltsnet
输入密码,ok。
4、重启apache服务
引用
net stop apache2
net start apache2
Tags:
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]