Allowing anonymous users in Trac (apache/mod_wsgi)

643 views Asked by At

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.

2

There are 2 answers

0
Pekka On BEST ANSWER

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

0
killdaclick On

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'>