Bug 720760

Summary: trac.wsgi appears to be a .conf file
Product: [Fedora] Fedora Reporter: Ryan <ryan.redhat>
Component: tracAssignee: Gwyn Ciesla <gwync>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: dcantrell, fschwarz, gwync
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-06 16:05:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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!