On Sep 5, 7:42 am, rjcarr <[EMAIL PROTECTED]> wrote:
> I have an existing (and fully functional) 0.10.4 database that I'm
> migrating to a new server running 0.10.5.  The setup of the old and
> new server should be identical ... it isn't that complicated.  The new
> server is Fedora 9 (the old server is Fedora 7).  The new server is
> using httpd and subversion from the install DVD.  I installed trac
> with yum (which also installed python-clearsilver).
>
> The httpd server is run as apache.  Subversion is served through
> apache and works fine (both from svn clients and web browsing the
> files).  Trac is served through apache using mod_python.  Here's the
> entry:
>
> <Location /trac>
>   SetHandler mod_python
>   PythonInterpreter main_interpreter
>   PythonHandler trac.web.modpython_frontend
>   PythonOption TracEnvParentDir /var/www/trac
>   PythonOption TracUriRoot /trac
> </Location>
>
> I was sure to set all the permissions in that /var/www/trac folder to
> apache.  I also made sure the SELinux tags were set appropriately.
> When I browse to the correct page, I get this:
>
> Internal Server Error
>
> 500 Internal Server Error (The user username requires read _and_ write
> permission to the database file /var/www/trac/admin/db/trac.db and the
> directory it is located in.)
>
> Where 'username' is the name of the user that is logged into the
> server and started apache.  Yes, that is strange ... it isn't apache
> but the user that logged into the server, before switching to root, to
> start apache.

Probably because you restarted Apache using:

  sudo /usr/sbin/apachectl start

or similar, instead of:

  sudo -H /usr/sbin/apachectl start

If you don't use -H option to sudo it will inherit parts of user
environment for user who rang sudo. This can actually cause a lot of
problems at times because things might appear to work, but when box
reboots and Apache started as root, without those parts of the user
environment application may fail.

> If I log in as root to start apache the username is root.  Strangely,
> I get the same error, even though root should have permission to
> everything.  However, just to test I did what it asked and made root
> the owner of all the files and gave everyone write permission and got
> the same error, so I think it is a misleading error and something else
> is going wrong.

The error is still misleading as Apache will switch to run as Apache
user. In doing that though, some parts of the environment may still
reflect that Apache was originally started as root.

Any file permissions must be such that Apache user has read/write
access as appropriate, not root.

What you may be better off doing is run Apache/mod_wsgi rather than
mod_python. For that you can use daemon mode of mod_wsgi and have
daemon process running Trac run as non root, not Apache user, ie.,
normal user account.

This can make it easier as you don't have to keep changing file
permissions but can leave them all as user used to setup Trac instance
in the first place.

Graham

> Checking the apache logs there is nothing that is interesting from
> what I can tell, but I'd be happy to share.
>
> I am completely stumped.  I first thought it was because I was trying
> to use a migrated database so I tried to upgrade the database, and it
> said:
>
> Database is up to date, no upgrade necessary.
>
> I then thought it was just the environment in some other way, so I
> created a new environment with initenv and got the same exact error.
> I then thought it could be a problem with accessing the database
> (since I didn't install sqlite) but in doing a trac-admin list I was
> able to get the right contents out.
>
> So ... I have no idea what to do.  I've been using trac for years and
> this is the first time I've had a serious problem.  My last resort, if
> I get no help, is to go back to using 0.10.4 (assuming that is the
> problem), but I'd like to avoid doing that.
>
> I can't upgrade to 0.11 at the moment, so that isn't an option either.
>
> Thanks, any advice is helpful.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to