在Trac中允许匿名用户(apache / mod_wsgi)

时间:2011-02-02 01:16:55

标签: apache mod-wsgi trac

我使用apache2和mod_wsgi安装并运行了很好的trac。然而,当用户试图访问甚至首页时,他们都会受到登录的欢迎。我尝试了几件事,但我尝试的所有内容都会一起禁用身份验证,或者不允许未经身份验证的用户查看该网站。这是我的httpd.conf文件的身份验证部分:

<Location '/'>
    AuthType Basic
    AuthName "Trac"
    AuthUserFile /home/trac/.htpasswd
    Require valid-user
</Location>

我几乎可以肯定解决方案在于需求线,但我已经耗尽了我的创造力。有什么想法吗?

编辑:我选择的答案效果很好。给出的链接没有关于connecting the password file to the system的说明。

2 个答案:

答案 0 :(得分:2)

我的记忆很模糊,但我遇到此问题时找到的唯一解决方案是从Apache身份验证切换到AccountManagerPlugin

答案 1 :(得分:2)

您可以指定apache何时应询问密码。

在trac中选择Login时,它将打开site:/ trac_folder / login

因此,定义身份验证的位置应该可以解决问题。 检查我的trac.conf:

WSGIScriptAlias /trac   /var/lib/trac/apache/trac.wsgi

## This is required if you plan to use HTTP authorization. Without it the
## user name won't be passed
WSGIPassAuthorization On

<Directory /trac>
    WSGIApplicationGroup %{GLOBAL}
    Order deny,allow
    Allow from all
    #AuthType Basic
    #AuthName "TracHaselko"
    #AuthUserFile /var/lib/trac/authfiles/htpasswd
    #Require valid-user
</Directory>

<Location /trac/login>
    AuthType Basic
    AuthName "TracHaslo"
    AuthUserFile /var/lib/trac/authfiles/htpasswd
    Require valid-user
</Location>

在你的档案变更中:

<Location '/'>

为:

<Location '/login'>
相关问题