apache 代理服务器 密码配置
用apache 设置代理服务器是,很多人设置过。但如何设置代理密码可能就少了。
其实配置也比较简单。就是文档少。
首先在原有配置上加上两行:
AuthName "Password Required"
AuthUserFile password.file
AuthGroupFile group.file
完整配置如下:
roxyRequests On
ProxyVia On<Proxy *>
Order deny,allow
Allow from all
AuthType Basic
AuthName "Password Required"
AuthUserFile password.file
AuthGroupFile group.file
Require group usergroup
</Proxy>
然后创建上面配置的密码文件。(好像操作倒过来了)
一、运行 Apache bin 目录下的 htpasswd.exe . 输入以下命令,username 就是你要设置的用户名
htpasswd.exe -c password.file username
二、回车,会提示你输入密码和确认密码。回车后创建完成
三、用文本编辑器创建文本文件,group.file 。内容为
usergroup: username
四、把这两个文件放到根目录下,操作结束。