[Trac] Re: [Trac 0.11b2] [apache+mod_python] Basic authentication configuration issue

2008-04-22 Thread Virtual Dust

Graham Dumpleton wrote:
> But what is in '/home/httpd/projects/'? Letting it fall back on to
> document root like this may itself cause problems if not careful
> depending on whether document root is empty or not.
>   
Like i said in the first post of this thread, the root directory is 
empty. But nothing change with stuff in it (even with a foo/ directory 
or a 'foo/login' file).
> Frankly, how mod_python hooks into Apache is a PITA as it causes
> various little oddities where the true target of a request as
> calculated by Apache, ie.,. SCRIPT_NAME equivalent, ends up being
> wrong. End result is that web applications have learned not to trust
> what mod_python passes it for some values in the request and
> applications work it out themselves from the request URI. This means
> though that the applications have to be told where the application is
> mounted if not mounted at root.
>
> In contrast, mod_wsgi hooks into Apache in a more traditional resource
> based approach like CGI configuration is done. This means SCRIPT_NAME
> is correct and you don't end up with these funny little problems like
> you are having when using Location directive to try and configure
> mod_python.
>
> In other words, you might consider looking at mod_wsgi instead of
> mod_python as it doesn't generally exhibit these odd little issues
> that mod_python sometimes can. :-)
>   
I didn't know about mod_wsgi. I will take a look at it and compare 
performances with mod_python. Thanks.
Anyway, the problem seems not to be directly linked with mod_python, 
since i had a similar problem with mod_dav_svn and a  
directive that i just resolved the same way.
> Graham
Raphaël


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~--~~~~--~~--~--~---



[Trac] Re: [Trac 0.11b2] [apache+mod_python] Basic authentication configuration issue

2008-04-22 Thread Graham Dumpleton

On Apr 23, 2:16 pm, Virtual Dust <[EMAIL PROTECTED]> wrote:
> Eirik Schwenke wrote:
> > I just now tested with the following in my local apache-config:
>
> > ~ 
> > ~  AuthType Basic
> > ~  AuthName "Projects"
> > ~  AuthUserFile /home/httpd/trac-env/trac.htpasswd
> > ~  Require valid-user
> > ~  
>
> > And it demanded login-credentials for all /foo/bar/login-urls i threw at it.
>
> > (Note the trailing $ didn't make any difference wrt wether or not the 
> > section
> > worked, but it's best to be reasonably specific about 
> > LocationMatch-directives,
> > in case they're included in a complex apache-config).
>
> > I'd double-check my apache-config for typos and see if the apache error.log 
> > has
> > anything helpful to add -- because as far as I can understand the code you
> > posted earlier *should* work.
>
> Let's do some magics...
>
> ~  DocumentRoot /home/httpd/projects
> ~
> ~  
> ~SetHandler mod_python
> ~PythonHandler trac.web.modpython_frontend
> ~PythonOption TracEnvParentDir /home/httpd/trac-env
> ~PythonOption TracUriRoot /
> ~SetEnv PYTHON_EGG_CACHE /home/httpd/.egg-cache
> ~PythonDebug On
> ~  
> ~
> ~  
> ~AuthType Basic
> ~AuthName "Projects"
> ~AuthUserFile /home/httpd/trac-env/trac.htpasswd
> ~Require valid-user
> ~  
>
> This is the initial configuration : i'm not asked for authentication 
> forhttp://projects.arcanes.home/foo/login
>
> Now...
>
> ~  DocumentRoot /home/httpd/projects
> ~
> *  
> ~SetHandler mod_python
> ~PythonHandler trac.web.modpython_frontend
> ~PythonOption TracEnvParentDir /home/httpd/trac-env
> ~PythonOption TracUriRoot /
> ~SetEnv PYTHON_EGG_CACHE /home/httpd/.egg-cache
> ~PythonDebug On
> *  
> ~
> ~  
> ~AuthType Basic
> ~AuthName "Trac Projects Authentication"
> ~AuthUserFile /home/httpd/trac-env/trac.htpasswd
> ~Require valid-user
> ~  
>
> (changed lines start with *)
> And... All is fine !!
>
> It seams that the Apache server deals with the  directive in
> a particular way. I don't know if it's a bug (just in my version ?),
> though. Maybe there is a real reason for that.

But what is in '/home/httpd/projects/'? Letting it fall back on to
document root like this may itself cause problems if not careful
depending on whether document root is empty or not.

Frankly, how mod_python hooks into Apache is a PITA as it causes
various little oddities where the true target of a request as
calculated by Apache, ie.,. SCRIPT_NAME equivalent, ends up being
wrong. End result is that web applications have learned not to trust
what mod_python passes it for some values in the request and
applications work it out themselves from the request URI. This means
though that the applications have to be told where the application is
mounted if not mounted at root.

In contrast, mod_wsgi hooks into Apache in a more traditional resource
based approach like CGI configuration is done. This means SCRIPT_NAME
is correct and you don't end up with these funny little problems like
you are having when using Location directive to try and configure
mod_python.

In other words, you might consider looking at mod_wsgi instead of
mod_python as it doesn't generally exhibit these odd little issues
that mod_python sometimes can. :-)

Graham
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~--~~~~--~~--~--~---



[Trac] Re: [Trac 0.11b2] [apache+mod_python] Basic authentication configuration issue

2008-04-22 Thread Virtual Dust

Eirik Schwenke wrote:
> I just now tested with the following in my local apache-config:
>
> ~ 
> ~  AuthType Basic
> ~  AuthName "Projects"
> ~  AuthUserFile /home/httpd/trac-env/trac.htpasswd
> ~  Require valid-user
> ~  
>
> And it demanded login-credentials for all /foo/bar/login-urls i threw at it.
>
> (Note the trailing $ didn't make any difference wrt wether or not the section
> worked, but it's best to be reasonably specific about 
> LocationMatch-directives,
> in case they're included in a complex apache-config).
>
> I'd double-check my apache-config for typos and see if the apache error.log 
> has
> anything helpful to add -- because as far as I can understand the code you
> posted earlier *should* work.

Let's do some magics...

~  DocumentRoot /home/httpd/projects
~
~  
~SetHandler mod_python
~PythonHandler trac.web.modpython_frontend
~PythonOption TracEnvParentDir /home/httpd/trac-env
~PythonOption TracUriRoot /
~SetEnv PYTHON_EGG_CACHE /home/httpd/.egg-cache
~PythonDebug On
~  
~
~  
~AuthType Basic
~AuthName "Projects"
~AuthUserFile /home/httpd/trac-env/trac.htpasswd
~Require valid-user
~  


This is the initial configuration : i'm not asked for authentication for 
http://projects.arcanes.home/foo/login

Now...

~  DocumentRoot /home/httpd/projects
~
*  
~SetHandler mod_python
~PythonHandler trac.web.modpython_frontend
~PythonOption TracEnvParentDir /home/httpd/trac-env
~PythonOption TracUriRoot /
~SetEnv PYTHON_EGG_CACHE /home/httpd/.egg-cache
~PythonDebug On
*  
~
~  
~AuthType Basic
~AuthName "Trac Projects Authentication"
~AuthUserFile /home/httpd/trac-env/trac.htpasswd
~Require valid-user
~  

(changed lines start with *)
And... All is fine !!

It seams that the Apache server deals with the  directive in 
a particular way. I don't know if it's a bug (just in my version ?), 
though. Maybe there is a real reason for that.


Thanks for your help !

Raphaël.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~--~~~~--~~--~--~---



[Trac] Re: [Trac 0.11b2] [apache+mod_python] Basic authentication configuration issue

2008-04-21 Thread Eirik Schwenke

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Virtual Dust skrev 21-04-2008 08:27:
| Eirik Schwenke wrote:
|> Does the webserver/webclient prompt for http-login on the url?
|>
| No, there is no prompt at all.
|> As I understand it, in the standard configuration, with basic http-auth
|> enabled, and python running through mod_python, trac acquires the 
http-username
|> from apache.
|>
|> Still, the locationmatch looks correct to me, which leaves an error in the
|> passwd-file name -- as apache should refuse to start if you're missing
|> mod_authn_file in the apache config.
|>
| if the passwd-file was not found (or in the wrong format), apache would
| prompt for authentication anyway, but never success.
|> Anything in the apache error.log ?
|>
|> You could try setting the log_level to DEBUG in trac.ini also -- might shed
|> some light on what goes wrong, and when.
|>
|
| I made some tests. At first, I explicitly set only one project:
| ...
| 
| ...
| PythonOption TracEnv /home/httpd/trac-env/test
| ...
| 
| ...
|
| With that, apache prompts for authentication and login process completes
| succesfully.
| Next, without reloading my browser, i restored my previous apache
| configuration and restarted the server : i reloaded the page in the
| browser. Login information was kept, and everything worked fine. But
| when I restarted the browser... No prompt, only the same error as
| ever... There is no relevant information in the log (Debug level is
| set). Only a WARNING: 500 Trac Error.
|
| This error persists even with an explicit  in
| place of the regexp.

You have diagnosed the problem -- your apache config is wrong, and does not
demand/request authentication from the client.

But apache is successfully forwarding the request username to trac, so once you
figure out what's wrong with the LocationMatch-stuff, you should be home free.

| Note that I did this test with several browsers (firefox 2, firefox 3,
| lynx, opera), to be sure it was not a bug in it.

Unfortunately that's redundant in this case. For help debugging problems like
this I recommend the firefox liveheaders extention:

~ http://livehttpheaders.mozdev.org/

It's more convenient that just telneting to port 80 and trying to remember how
to speak http/1.1 fluently -- if not as much fun ;-)

| I will try with Trac 0.10 this afternoon or tomorrow to see if the
| problem may come from Trac 0.11b2.

It most likely won't - The problem is with apache not requesting authentication.

| I keep you informed.

I just now tested with the following in my local apache-config:

~ 
~  AuthType Basic
~  AuthName "Projects"
~  AuthUserFile /home/httpd/trac-env/trac.htpasswd
~  Require valid-user
~  

And it demanded login-credentials for all /foo/bar/login-urls i threw at it.

(Note the trailing $ didn't make any difference wrt wether or not the section
worked, but it's best to be reasonably specific about LocationMatch-directives,
in case they're included in a complex apache-config).

I'd double-check my apache-config for typos and see if the apache error.log has
anything helpful to add -- because as far as I can understand the code you
posted earlier *should* work.


Best regards,

- --
~ .---.  Eirik Schwenke <[EMAIL PROTECTED]>
( NSD ) Harald Hårfagresgate 29Rom 150
~ '---'  N-5007 Bergentlf: (555) 889 13

~  GPG-key at pgp.mit.edu  Id 0x8AA3392C
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIDJRfxUW7FIqjOSwRAu02AKDM0eL7rERAWXfcuJfBwtd64/D9gQCgge0A
A2nkCdrVfZO8o3rA5NXoj8Y=
=cxZd
-END PGP SIGNATURE-

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~--~~~~--~~--~--~---



[Trac] Re: [Trac 0.11b2] [apache+mod_python] Basic authentication configuration issue

2008-04-20 Thread Virtual Dust

Eirik Schwenke wrote:
> Does the webserver/webclient prompt for http-login on the url?
>   
No, there is no prompt at all.
> As I understand it, in the standard configuration, with basic http-auth
> enabled, and python running through mod_python, trac acquires the 
> http-username
> from apache.
>
> Still, the locationmatch looks correct to me, which leaves an error in the
> passwd-file name -- as apache should refuse to start if you're missing
> mod_authn_file in the apache config.
>   
if the passwd-file was not found (or in the wrong format), apache would 
prompt for authentication anyway, but never success. 
> Anything in the apache error.log ?
>
> You could try setting the log_level to DEBUG in trac.ini also -- might shed
> some light on what goes wrong, and when.
>   

I made some tests. At first, I explicitly set only one project:
...

...
PythonOption TracEnv /home/httpd/trac-env/test
...

...

With that, apache prompts for authentication and login process completes 
succesfully.

Next, without reloading my browser, i restored my previous apache 
configuration and restarted the server : i reloaded the page in the 
browser. Login information was kept, and everything worked fine. But 
when I restarted the browser... No prompt, only the same error as 
ever... There is no relevant information in the log (Debug level is 
set). Only a WARNING: 500 Trac Error.

This error persists even with an explicit  in 
place of the regexp.

Note that I did this test with several browsers (firefox 2, firefox 3, 
lynx, opera), to be sure it was not a bug in it.

I will try with Trac 0.10 this afternoon or tomorrow to see if the 
problem may come from Trac 0.11b2.

I keep you informed.

Raph.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~--~~~~--~~--~--~---



[Trac] Re: [Trac 0.11b2] [apache+mod_python] Basic authentication configuration issue

2008-04-18 Thread Eirik Schwenke

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Virtual Dust skrev 16-04-2008 21:54:
| Erik Bray wrote:
|> On Wed, Apr 16, 2008 at 11:59 AM, Virtual Dust <[EMAIL PROTECTED]> wrote:
|>
|>>  After browsing mailing-list archives and checking so many times my
|>>  configuration, i failed to resolve this "Authentication information not
|>>  available" error on http://projects.arcanes/myproject/login
|>>
|> I didn't notice anything immediately wrong with your configuration.
|> Just to ask a possibly stupid question: Did you try restarting Apache?
|>
| Yes i did. After any modification in apache configuration. If only it
| could have been so simple. :)

Does the webserver/webclient prompt for http-login on the url?

As I understand it, in the standard configuration, with basic http-auth
enabled, and python running through mod_python, trac acquires the http-username
from apache.

Still, the locationmatch looks correct to me, which leaves an error in the
passwd-file name -- as apache should refuse to start if you're missing
mod_authn_file in the apache config.

Anything in the apache error.log ?

You could try setting the log_level to DEBUG in trac.ini also -- might shed
some light on what goes wrong, and when.


- --
~ .---.  Eirik Schwenke <[EMAIL PROTECTED]>
( NSD ) Harald Hårfagresgate 29Rom 150
~ '---'  N-5007 Bergentlf: (555) 889 13

~  GPG-key at pgp.mit.edu  Id 0x8AA3392C
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFICPucxUW7FIqjOSwRAj+aAKCjqR3yljXAjrejBWbg8brIlOjN0wCfTvOE
RO0s0z6N6GEgbORAaVwAzGQ=
=C2eI
-END PGP SIGNATURE-

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~--~~~~--~~--~--~---



[Trac] Re: [Trac 0.11b2] [apache+mod_python] Basic authentication configuration issue

2008-04-16 Thread Virtual Dust

Erik Bray wrote:
> On Wed, Apr 16, 2008 at 11:59 AM, Virtual Dust <[EMAIL PROTECTED]> wrote:
>   
>>  After browsing mailing-list archives and checking so many times my
>>  configuration, i failed to resolve this "Authentication information not
>>  available" error on http://projects.arcanes/myproject/login
>> 
>
> I didn't notice anything immediately wrong with your configuration.
> Just to ask a possibly stupid question: Did you try restarting Apache?
>   
Yes i did. After any modification in apache configuration. If only it 
could have been so simple. :)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~--~~~~--~~--~--~---



[Trac] Re: [Trac 0.11b2] [apache+mod_python] Basic authentication configuration issue

2008-04-16 Thread Erik Bray

On Wed, Apr 16, 2008 at 11:59 AM, Virtual Dust <[EMAIL PROTECTED]> wrote:
>  After browsing mailing-list archives and checking so many times my
>  configuration, i failed to resolve this "Authentication information not
>  available" error on http://projects.arcanes/myproject/login

I didn't notice anything immediately wrong with your configuration.
Just to ask a possibly stupid question: Did you try restarting Apache?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~--~~~~--~~--~--~---