Mongrel, Apache and Basic Auth

配置所有的访问均需要提供用户名及密码,使用Apache的Basic Auth,需要生成一个密码文件(用 htpasswd2 文件创建)

1
2
3
4
5
6
7
8
9
10
<Proxy balancer://my_awesome_cluster>
        BalancerMember http://127.0.0.1:9000
        BalancerMember http://127.0.0.1:9001
        
        AllowOverride AuthConfig
        AuthType Basic
        AuthName "Top Secret"
        AuthUserFile /etc/apache2/authorized_users.passwd
        Require valid-user
</Proxy>

创建密码文件

1
2
3
cd /etc/apache2/
htpasswd2 -c authorized_users.passwd user1
htpasswd2 authorized_users.passwd user2

Wiki首页 | 查看所有 | 编辑 | 输出到博客 | 历史版本