[Trac] Trac on Apache Server with mod_python

2 views
Skip to first unread message

akabat

unread,
May 10, 2010, 6:58:21 AM5/10/10
to Trac Users
Hi,

I'm just doing a Trac installation.
I'm running Trac on an Apache Webserver with mod_python on a Windows
machine. In the Trac Guide there is written this:


======================================
Generating the Trac cgi-bin directory ¶


In order for Trac to function properly with FastCGI or mod_python,
you
need to have a trac.cgi file. This is an executable which loads the
appropriate Python code. It can be generated using the deploy option
of trac-admin.


There is, however, a bit of a chicken-and-egg problem. The trac-admin
command requires an existing environment to function, but complains
if
the deploy directory already exists. This is a problem, because
environments are often stored in a subdirectory of the deploy. The
solution is to do something like this:


mkdir -p /usr/share/trac/projects/my-project
trac-admin /usr/share/trac/projects/my-project initenv
trac-admin /usr/share/trac/projects/my-project deploy /tmp/deploy
mv /tmp/deploy/* /usr/share/trac

======================================


Now my questions:
1. Do i have to do that really? It works without that, too.
2. Whereto do I copy the generated directories? In my Apache
installation or in my Trac environment?


Thanks in advance!
akabat

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

Cooke, Mark

unread,
May 10, 2010, 8:03:19 AM5/10/10
to trac-...@googlegroups.com
>
> I'm just doing a Trac installation.
> I'm running Trac on an Apache Webserver with mod_python on a Windows
> machine. In the Trac Guide there is written this:
>
Umm, is there any reason why you are using mod_python? From what I researched, mod_wsgi seems to be the recommended and actively maintained alternative with some excellent documentation by Graham Dumpleton:-

http://code.google.com/p/modwsgi/
http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac

>
> ======================================
> Generating the Trac cgi-bin directory ¶
>
> In order for Trac to function properly with FastCGI or mod_python,
> you
> need to have a trac.cgi file. This is an executable which loads the
> appropriate Python code. It can be generated using the deploy option
> of trac-admin.
>
> There is, however, a bit of a chicken-and-egg problem. The trac-admin
> command requires an existing environment to function, but complains
> if the deploy directory already exists. This is a problem, because
> environments are often stored in a subdirectory of the deploy. The
> solution is to do something like this:
>
> mkdir -p /usr/share/trac/projects/my-project
> trac-admin /usr/share/trac/projects/my-project initenv
> trac-admin /usr/share/trac/projects/my-project deploy /tmp/deploy
> mv /tmp/deploy/* /usr/share/trac
>
> ======================================
>
> Now my questions:
> 1. Do i have to do that really? It works without that, too.
> 2. Whereto do I copy the generated directories? In my Apache
> installation or in my Trac environment?
>
...you will need to create a .wsgi script for Trac using mod_wsgi but Graham provides excellent examples in the links above.
>
> Thanks in advance!
> akabat
>
No problem, I hope this helps...

~ mark c

akabat

unread,
May 10, 2010, 10:43:21 AM5/10/10
to Trac Users
On May 10, 2:03 pm, "Cooke, Mark" <mark.co...@siemens.com> wrote:
> Umm, is there any reason why you are using mod_python?  From what I researched, mod_wsgi seems to be the recommended and actively maintained alternative with some excellent documentation by Graham Dumpleton:-

I installed the version 0.11.7 of Trac because I didn't want to
install a beta version. And in the 0.11 Trac Guide they recommend
mod_python.

akabat

Cooke, Mark

unread,
May 10, 2010, 11:24:41 AM5/10/10
to trac-...@googlegroups.com


>> On May 10, 2:03 pm, "Cooke, Mark" <mark.co...@siemens.com> wrote:
>> Umm, is there any reason why you are using mod_python?  
>> From what I researched, mod_wsgi seems to be the recommended
>> and actively maintained alternative with some excellent
>> documentation by Graham Dumpleton:-
>>
> -----Original Message-----
> From: trac-...@googlegroups.com On Behalf Of akabat
> Sent: 10 May 2010 15:43
>
> I installed the version 0.11.7 of Trac because I didn't want to
> install a beta version. And in the 0.11 Trac Guide they recommend
> mod_python.
>
As far as I know mod_python is currently unmaintained (last update at http://www.modpython.org/ is listed as Jan 2008) and has "some issues" which are therefore unlikely to be fixed.

WSGI seems to be a modern standard way to support python web apps and is currently actively developed and supported (as mod_wsgi) by Graham Dumpleton. If you search t.e.o you will find pages about using mod_wsgi: http://trac.edgewall.org/wiki/TracModWSGI but just checking does show that the standard install doc uses mod_python and ignores mod_wsgi...

Anyway, in summary I use mod_wsgi for a multi-parent-root setup on windoze server and am very happy with it.

~ mark c

Noah Kantrowitz

unread,
May 10, 2010, 1:42:34 PM5/10/10
to trac-...@googlegroups.com
Not sure who wrote that bit of documentation, but it is entirely
wrong. See https://coderanger.net/~coderanger/tracdoc/install/
mod_python.html

--Noah
Reply all
Reply to author
Forward
0 new messages