是否有可能在Apache2的二级密码文件? [英] Is it possible to have two password files in Apache2?

查看:131
本文介绍了是否有可能在Apache2的二级密码文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以有两个的AuthUserFile指令在启用站点-的Apache2 / / 000-默认的配置文件?

 <位置/回购/ TRAC>
      AuthType选项基本
      AuthName指令Trac系统
      AuthUserFile文件在/ etc / apache2的/ passfile1
      AuthUserFile文件在/ etc / apache2的/ passfile2
      需要有效的用户
    < /地点>

我要为两种类型的用户名/密码。


  • DEV - 可以访问SVN和Trac

  • NOM - 只能访问Trac的

我有两个选择:保持了Trac的和svn单独的密码文件,并分别包含它们,或者在1我把DEV其他NOM 2密码文件,仅包括1 SVN和包括两个下TRAC位置。

解决方案

您应该一切进入一个密码文件,然后使用组来控制访问特定的资源。您可以创建的/ etc / apache2的/组与线沿线的内容:

  DEV:鲍勃·爱丽丝
NOM:规范弗雷德巴特

然后修改你的配置,所以它看起来是这样的:

 <位置/回购/ TRAC>
  AuthType选项基本
  AuthName指令Trac系统
  AuthUserFile文件在/ etc / apache2的/密码文件
  目录AuthGroupFile的/ etc /的Apache2 /组
  要求组DEV NOM
< /地点>

这将使 DEV NOM 组的成员访问该资源。

如果您的真正的要使用多个密码文件,请参阅文档mod_authn_alias ,该有一个不正是这样一个例子。

Can I have two AuthUserFile directives in an apache2/sites-enabled/000-default configuration file?

    <Location /repo/trac>
      AuthType Basic
      AuthName "Trac"
      AuthUserFile /etc/apache2/passfile1
      AuthUserFile /etc/apache2/passfile2
      Require valid-user
    </Location>

I want username/password for two types of users.

  • DEV - can access SVN and Trac
  • NOM - can only access Trac

I have two options: keep separate password files for Trac and Svn and include them separately, or have 2 password files in 1 I put DEV in other NOM and include only 1 for svn and include two under trac location.

解决方案

You should move everything into a single password file and then use groups to control access to particular resources. You can create /etc/apache2/groups with contents along the lines of:

DEV: bob alice
NOM: norm fred bart

And then modify your configuration so it looks like this:

<Location /repo/trac>
  AuthType Basic
  AuthName "Trac"
  AuthUserFile /etc/apache2/passfile
  AuthGroupFile /etc/apache2/groups
  Require group DEV NOM
</Location>

This would allow members of the DEV and NOM groups to access this resource.

If you really want to use multiple password files, see the documentation for mod_authn_alias, which has an example that does exactly this.

这篇关于是否有可能在Apache2的二级密码文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆