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

发布于 2024-10-15 13:16:35 字数 534 浏览 0 评论 0原文

我已经安装了 trac,并且使用 apache2 和 mod_wsgi 运行得很好。然而,当用户尝试访问首页时,他们会收到登录信息。我已经尝试了几件事,但我尝试的所有事情要么一起禁用身份验证,要么不允许未经身份验证的用户查看该网站。这是我的 httpd.conf 文件的身份验证部分:

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

我几乎可以肯定解决方案位于 require 行中,但我已经耗尽了我的创造力。有什么想法吗?

编辑:我选择的答案效果很好。给出的链接没有有关将密码文件连接到系统的说明。

I have trac installed and running great using apache2 and mod_wsgi. However when ever a user tries to access even the front page they are greeted with a login. I've tried several things, but everything I try either disables the authentication all together or won't allow unauthenticated users to view the site. Here's the authentication section of my httpd.conf file:

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

I'm almost certain that the solution lies int the require line but I've exhausted my ow creativity. Any thoughts?

EDIT: The answer I selected works great. The link given doesn't have instructions on connecting the password file to the system.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

羁绊已千年 2024-10-22 13:16:35

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

My memory is hazy, but the only solution I found when I had this issue was switching to from Apache authentication to the AccountManagerPlugin.

白况 2024-10-22 13:16:35

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

在 trac 中,当您选择“登录”时,它将打开站点:/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'>

You can specify when apache should ask about password.

In trac when you select Login it will open site: /trac_folder/login

So defining location for authentication should do the trick.
Check my 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>

In you file change:

<Location '/'>

to:

<Location '/login'>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文