How did you create that .htusers file? There isn't supposed to be a /login folder anywhere on the filesystem, the entire webpage is generated dynamically.

--Noah

Harold Naparst wrote:
OK.  Not that the documentation was clear at all about that, but
I have removed the "simple configuration" and followed the instructions
in the "Virtual Host Configuration."  I also upgraded to mod_python 3.2.10
as per your posting, since I am running Apache 2.2.2.  The behavior is
exactly
the same, however.  Black & white page with the login link at the top.
When I hit login, I get a permission denied to /login. The apache log shows

xxx.xxx.xxx.xxx - - [05/Aug/2006:09:03:51 +0200] "GET /login HTTP/1.1" 403
286 "http://trac.widgets-r-us.com/"; "Mozilla/5.0 (X11; U; Linux i686; en-US;
rv:1.7.12) Gecko/20060208 Firefox/1.0.7"

The httpd.conf is now:


<VirtualHost *:80>
   DocumentRoot /var/trac/widgets
    ServerName trac.widgets-r-us.com
   Alias /trac /usr/share/trac/htdocs (since /var/trac/widgets/htdocs is
empty)
   <Location />

       SetHandler mod_python
       PythonHandler trac.web.modpython_frontend
       PythonOption TracEnv /var/trac/widgets
       PythonOption TracUriRoot /
    </Location>
   <Location /login>
       AuthType Basic
       AuthName "widgets Trac Server"

       AuthUserFile /var/trac/widgets/.htusers
       Require valid-user
   </Location>
    <LocationMatch /trac/>
       SetHandler None
   </LocationMatch>
</VirtualHost>

None of this is suprising to me.   There is no login directory under
/var/trac/widgets,
so how is Apache supposed to be able to return the page?  Actually, I
suprised that
the error message didn't say "Couldn't find page /login."

So, out of a sense of desperation I randomly commented out the line
  PythonOption TracUriRoot /
Don't ask me why.  I didn't know what else to do. TracUriRoot is not
explained
in the docs, except for a line saying that maybe you need it, and maybe you
don't.
So I thought maybe I'd try removing it.  Why not.
The result was something different.   Now I get a decorated page with the
trac wolf
print.  Nice looking.  When I hit login,

Oops… *Trac detected an internal error:*

If you think this really should work and you can reproduce it, you should
consider reporting this problem to the Trac team.

Go to http://trac.edgewall.org/ and create a new ticket where you describe
the problem, how to reproduce it. Don't forget to include the Python
traceback found below.

TracGuide <http://trac.weberp.se/error/wiki/TracGuide> — The Trac User and
Administration Guide
Python Traceback

Traceback (most recent call last):
 File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 335,
in dispatch_request
   dispatcher.dispatch(req)
 File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 220,
in dispatch
   resp = chosen_handler.process_request(req)
 File "/usr/lib/python2.4/site-packages/trac/web/auth.py", line 95,
in process_request
   self._do_login(req)
 File "/usr/lib/python2.4/site-packages/trac/web/auth.py", line 116,
in _do_login
   assert req.remote_user, 'Authentication information not available.'
AssertionError: Authentication information not available.

Is that progress?

On 8/5/06, Matthew Good <[EMAIL PROTECTED]> wrote:

On Fri, 2006-08-04 at 22:33 +0200, Harold Naparst wrote:
> I am completely confused by
> http://trac.edgewall.org/wiki/TracModPython
> I got trac running using tracd in about 10 minutes, and have spent the
> past six
> hours trying to understand what that wiki page could possibly be
> saying.
>
> I installed the project environment to /var/trac/widgets.  The entire
> directory and all subdirectories
> are owned by apache.
...snip...
> <Location /projects/widgets>
>   SetHandler mod_python
>   PythonHandler trac.web.modpython_frontend
>    PythonOption TracEnv /var/trac/widgets
>    PythonOption TracUriRoot "/projects/widgets"
> </Location>
>
> <Location /projects/widgets/login>
>   AuthType Basic
>   AuthName "widgets"
>   AuthUserFile /var/trac/widgets/.htaccess
>   Require valid-user
> </Location>
>
> <VirtualHost *:80>
>     DocumentRoot /var/trac/widgets
>      ServerName widgets-r-us.com
>     <Directory />
>         SetHandler mod_python
>         PythonHandler trac.web.modpython_frontend
>         PythonOption TracEnv /var/trac/widgets
>         PythonOption TracUriRoot /
>     </Directory>
>     <Location /login>
>         AuthType Basic
>         AuthName "Widget Trac Server"
>         AuthUserFile /var/trac/widgets/.htusers
>         Require valid-user
>     </Location>
> </VirtualHost>
>
> Then I restart httpd, browse to widgets-r-us.com, wait about 30
> seconds, and I get a black and white page (no
> decorations), with a Search box, a list of actions (the first one is
> login), and then a Welcome to Trac 0.10 message.

You're mixing two different ways of configuring mod_python.  Either use
the "Simple Configuration" section, or the "Virtual Host Configuration"
section, but you shouldn't have both.

Also <Directory /> is not equivalent to <Location />.  The <Directory>
block is used to configure access to actual file paths on your local
filesystem, which is not what you want.  You need to use <Location />
when configuring Trac.

--
Matthew Good <[EMAIL PROTECTED]>

_______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac



------------------------------------------------------------------------

_______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac

_______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac

Reply via email to