M*****o 发帖数: 13 | 1 我想限制一个主页被访问,我使用apache作为web server.请问如何加入用户和口令呢?
谢谢 | kb 发帖数: 73 | 2 put it in a folder and put .htaccess in that folder. Specify the username
and password in .htaccess.
Google .htaccess to see its format. | a*****1 发帖数: 11 | 3
username
no, you can NOT put user/pswd in .htaccess
If you use only basic authentication, you generally
want to use 'htpasswd' to generate user/pswd pairs and put
the user/pswd file in a safe place, like your ServerRoot.
and then write down something in .htaccess of your local
directory or the corresponding | section
in httpd.conf, like
AuthType Basic
AuthName "passwd protection"
AuthUserFile /etc/apache2/ht_user_pswd_file
Require valid-user
You can "Require
【在 kb 的大作中提到】![](/moin_static193/solenoid/img/up.png) : put it in a folder and put .htaccess in that folder. Specify the username : and password in .htaccess. : Google .htaccess to see its format.
|
|