No handler matched request to /login for Trac 1.0 using WSGI

2k views Asked by At

I am trying to configure Trac 1.0 on Apache 2.4 using WSGI in Ubuntu 13.10. I have multiple Trac projects. I used to use mod_python but this is not longer suggested and I am a bit lost. I used trac-admin /path/to/project deploy /path/to/project to generate my trac.wsgi. I then configured a new site in /etc/apache2/sites-available like this:

WSGIScriptAliasMatch ^/trac/([^/]+) /data/trac/$1/cgi-bin/trac.wsgi
<Directory /data/trac>
    WSGIApplicationGroup %{GLOBAL}
    Options +Indexes +ExecCGI +SymLinksIfOwnerMatch
    AllowOverride None
    Require all granted
</Directory>

<LocationMatch /trac/[^/]+/login>
   AuthType Basic
   AuthName "Trac Authentication"
   AuthUserFile /data/access/htpassword
   Require valid-user
</LocationMatch>

and created a link in sites-enabled and restarted apache. I had removed all permissions for the trac modules (I originally had the project running on an old 0.11 version, I did the upgrade steps described on the Trac site) so I get a msg saying I need to login, but once I have entered my creds I get the error in the subject.

Does anyone know why?

Thanks, Gabriel

1

There are 1 answers

0
Gabriel On

yes, I have. I ended up installing a plugin that redirects the user to the login page: http://trac-hacks.org/wiki/PermRedirectPlugin, this works great.

I think it is due to the fact that I don't give unauthenticated users access to anything, on Trac 0.11 this simply displayed a msg asking them to login and once they logged in they got sent to the main wiki page. With 1.0 they must have changed this behavior so it no longer works with my usecase. I think it is cleaner with this plugin in cases like mine where unauthenticated uses don't see anything, it should be the default in this case.

Thanks