Authentication with mod_wsgi and Apache

107 views
Skip to first unread message

Caleb

unread,
Apr 15, 2012, 6:23:55 PM4/15/12
to trac-...@googlegroups.com
I'm having problems getting authentication working with mod_wsgi and Apache. 
I'm running trac on my webserver which has Cent OS and Apache, MySQL and mod_wsgi plugins

TRAC Error
Authentication information not available. Please refer to the installation documentation. 

Here is my .conf file for the site I'm trying to enable: 

WSGIScriptAlias /trac /home/my-site/public_html/trac/trac.wsgi

<Directory /home/my-site/public_html/trac/cgi-bin/>
  WSGIApplicationGroup %{GLOBAL}
  Order deny,allow
  Allow from all
</Directory>

  ServerName dev.my-site.com
  DocumentRoot /home/my-site/public_html/trac/htdocs/
  WSGIScriptAlias / /home/my-site/public_html/trac/cgi-bin/trac.wsgi
  <Location /login>
    AuthType Basic
    AuthName "Trac"
    AuthUserFile /home/my-site/public_html/trac/htpasswd
    Require valid-user
  </Location>
</VirtualHost>

Can someone please help? 

thanks,
caleb


Caleb

unread,
Apr 15, 2012, 7:50:39 PM4/15/12
to trac-...@googlegroups.com

I have changed the following to this and now I get the error below. Any help would be appreciated!
  
<Location /home/my-site/public_html/trac/login>

    AuthType Basic
    AuthName "Trac"
    AuthUserFile /home/my-site/public_html/trac/htpasswd
    Require valid-user
  </Location>


Error: Not Found

No handler matched request to /401.shtml

Thanks,
Caleb

Cooke, Mark

unread,
Apr 16, 2012, 4:57:09 AM4/16/12
to trac-...@googlegroups.com
[Note: convention here is to add at the end so it is easier to read...]

> On Sunday, April 15, 2012 5:23:55 PM UTC-5, Caleb wrote:
>
> I'm having problems getting authentication working with
> mod_wsgi and Apache.
> I'm running trac on my webserver which has Cent OS and
> Apache, MySQL and mod_wsgi plugins
>
> TRAC Error
> Authentication information not available. Please refer
> to the installation documentation

> http://dev.pravusmedia.com/wiki/TracInstall#ConfiguringAuthentication


>
>
> Here is my .conf file for the site I'm trying to enable:
>
> WSGIScriptAlias /trac /home/my-site/public_html/trac/trac.wsgi
>
> <Directory /home/my-site/public_html/trac/cgi-bin/>
> WSGIApplicationGroup %{GLOBAL}
> Order deny,allow
> Allow from all
> </Directory>
>
> ServerName dev.my-site.com
> DocumentRoot /home/my-site/public_html/trac/htdocs/
> WSGIScriptAlias /
> /home/my-site/public_html/trac/cgi-bin/trac.wsgi
> <Location /login>
> AuthType Basic
> AuthName "Trac"
> AuthUserFile /home/my-site/public_html/trac/htpasswd
> Require valid-user
> </Location>
> </VirtualHost>
>
> Can someone please help?
>
> thanks,
> caleb
>

> -----Original Message-----
> From: trac-...@googlegroups.com
> [mailto:trac-...@googlegroups.com] On Behalf Of Caleb
> Sent: 16 April 2012 00:51
> To: trac-...@googlegroups.com
> Subject: [Trac] Re: Authentication with mod_wsgi and Apache
>
>
> I have changed the following to this and now I get the error
> below. Any help would be appreciated!
>
> <Location /home/my-site/public_html/trac/login>
> AuthType Basic
> AuthName "Trac"
> AuthUserFile /home/my-site/public_html/trac/htpasswd
> Require valid-user
> </Location>
>
>
> Error: Not Found
>
>
> No handler matched request to /401.shtml
>
> Thanks,
> Caleb
>

Your specific error looks like there is something wrong with the local config for serving error pages as 401 is `Similar to 403 Forbidden, but specifically for use when authentication is possible but has failed or not yet been provided.`

I'm not that familiar with apache on *nix but have you made sure all of the required modules are loaded? Check out the apache httpd docs for all your directives to find out which modules provide the directives e.g. `AuthUserFile` is provided by mod_authn_file:-

http://httpd.apache.org/docs/2.2/mod/mod_authn_file.html#authuserfile

~ mark c

Reply all
Reply to author
Forward
0 new messages