我们的网站放在 LIUNX服务器上的时候,有时候为了保护网站的某些目录

要用到apache的 设置目录保护的功能 ,

下面的网站生成 htpasswd 密码

http://tools.dynamicdrive.com/password/

 

htaccess  的书写规则为

 

AuthName "Username and password required fa256weica zh zf diannao"

AuthType Basic

AuthUserFile /这里填你的密码文件的路径/.htpasswd

AuthGroupFile /dev/null

require valid-user

Order Deny,Allow

Deny from all

Allow from localhost

Allow from 113.87.170.00/24

Satisfy Any