Redian新闻
>
Apache中如何加入用户和口令?
avatar
Apache中如何加入用户和口令?# Unix - 噫吁兮,危乎高哉
M*o
1
我想限制一个主页被访问,我使用apache作为web server.请问如何加入用户和口令呢?
谢谢
avatar
kb
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.
avatar
a*1
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 的大作中提到】
: put it in a folder and put .htaccess in that folder. Specify the username
: and password in .htaccess.
: Google .htaccess to see its format.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。