Bug 720760 - trac.wsgi appears to be a .conf file
Summary: trac.wsgi appears to be a .conf file
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: trac
Version: 15
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-12 17:08 UTC by Ryan
Modified: 2013-01-10 06:38 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-06 16:05:12 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ryan 2011-07-12 17:08:26 UTC
Description of problem:

It appears that trac.wsgi is the configuration lines that need to be in the Apache conf something more like trac.conf under /etc/httpd/conf.d

Version-Release number of selected component (if applicable):
trac-0.12.2-5.fc15

How reproducible:
Install the RPM
  
Actual results:
Trac failed to work after upgrading (could be my setup as I host multiple trac projects and sites.


Expected results:
--snip /var/www/cgi-bin/trac.wsgi--
import trac.web.main
application = trac.web.main.dispatch_request
--end trac.wsgi--

Replacing the file in the RPM with above fixed my problem.  Basic idea from here: http://trac.edgewall.org/wiki/TracModWSGI#Averybasicscript

This works because I set a number of the variables in my conf file like:

--snip /etc/httpd/conf.d/trac.conf--
WSGIDaemonProcess wiki-trac display-name=wiki-trac threads=5 maximum-requests=100000
<Location "/trac/wiki">
        SetEnv trac.env_path /var/www/html/code/projects-html/wiki
        WSGIProcessGroup wiki-trac
</Location>
WSGIScriptAlias /trac/wiki /var/www/cgi-bin/trac.wsgi
--end snip--


Additional info:

Not sure if it works another way however I don't think the way it is currently setup follows the way the Trac people do it.

Comment 1 Ryan 2011-12-09 01:04:01 UTC
Anyone care?  

Is what I'm stating wrong??

Comment 2 Gwyn Ciesla 2011-12-09 01:33:34 UTC
I'm not sure, I'm not 100% it matters, if the required options are set both places.  Jesse, opinion?

Comment 3 Jesse Keating 2011-12-09 02:25:35 UTC
I'm not sure either, I haven't used trac in a wsgi setup yet.  I haven't really been paying attention to Trac in a while, focused on other stuff.

Comment 4 Felix Schwarz 2011-12-09 09:28:08 UTC
(In reply to comment #1)
> Is what I'm stating wrong??


Ryan, you're 100% right. The trac.wsgi file should be generated using trac-admin with an existing environment.

Also I doubt the that trac.cgi/trac.fcgi files will work as no environment is set. 

Furthermore IMHO we should not put anything in /var/www.

Well, a lot of stuff to do. I know how to fix it but I'm hesitant taking this bug as I have too much on my plate currently.

Comment 5 Ryan 2011-12-09 23:53:50 UTC
Well Trac recommends using trac in FastCGI, standalone, or WSGI.  Really it would depend on what is thought to be the default mode for Fedora.  

I personally prefer the WSGI method as it supports fine grain control and I'm also able to create unique track sites in their own processes, permissions, and plugin support.

Maybe a separate package could be made called trac-apache-wsgi and then configure it accordingly.

Comment 6 Gwyn Ciesla 2012-01-31 15:56:51 UTC
Felix, have you had a chance to look at this?  If you've got something in an can I could run with it.

Comment 7 Felix Schwarz 2012-01-31 22:59:51 UTC
(In reply to comment #6)
> Felix, have you had a chance to look at this?

No I don't have anything working right now. 

IMHO the right fix is:
 - not to add any file in /var/www/...
 - not to ship a trac.wsgi/trac.cgi file as these files should be generated by 'trac-admin <env> deploy'
 - mention the commands to generate trac.*gi in README.fedora

A slightly more extensive solution would be to generate a trac env in a temp location during the rpm build and run 'trac-admin deploy' on that env. Throw away the trac.*gi files but we could move all the extracted static resources to /usr/share/trac... so users without additional plugins can point their apache to that directory to get the load speed up.

Comment 8 Gwyn Ciesla 2012-02-02 14:21:16 UTC
What about including example trac.*gi files, but in %doc?

Comment 9 Felix Schwarz 2012-02-02 14:30:26 UTC
(In reply to comment #8)
> What about including example trac.*gi files, but in %doc?

A self-contained trac.*gi file sets some variables which contain the absolute path to the trac environment. Alternatively you have to set environment variables in Apache for each project.

Including these files (without specific paths) in %doc is ok, but README.fedora should still mention trac-admin deploy as this the preferred upstream way.

Comment 10 Gwyn Ciesla 2012-02-06 16:05:12 UTC
Fixed in rawhide.  Thanks for pointing this out!


Note You need to log in before you can comment on or make changes to this bug.