Edgewall Software
Modify

Opened 9 years ago

Closed 6 years ago

#6827 closed task (fixed)

trac.cgi missing in 0.11 setup??

Reported by: edunne Owned by: Noah Kantrowitz
Priority: normal Milestone: 0.12
Component: web frontend Version: 0.11b1
Severity: blocker Keywords: documentation
Cc: dgynn@…, AndrejsC@…
Release Notes:
API Changes:

Description

I've got Genshi, the latest version of setup tools etc.

trac-admin works fine and I can run TRAC standalone using tracd.

However, I'm trying to get it to run through Apache using simple cgi as the initial way to do deployment. With 0.10.x you just specified in the apache conf file that apache should use trac-cgi to handle requests.

However, I've searched my entire hard-drive and there is no trac-cgi that can be found.

It used to be dumpe in the python24/share/trac/cgi-bin directory but with python25 there is no share folder.

any idea where trac-cgi has disapeared to? Is it even necessary anymore (that docs aren't that specific for windows deployment of 0.11)?

Attachments (2)

trac-setup-data-files.dif (1.4 KB) - added by Dave Gynn <dgynn@…> 8 years ago.
patch to provide data_files for install_data
trac-setup-data-files.diff (1.6 KB) - added by Dave Gynn <dgynn@…> 8 years ago.
updated patch with correct htdocs subdirectories

Download all attachments as: .zip

Change History (25)

comment:1 Changed 9 years ago by edunne

anyway, I copied the old 0.10.x trac.cgi file and modified it so that it used python25 etc.

Seems to work, just not sure why it was missing from the 0.11 setup.

comment:2 Changed 9 years ago by edunne

oh and sorry my initial description I kept typing trac-cgi instead of trac.cgi

comment:3 Changed 9 years ago by osimons

Milestone: 0.11.1

The scripts are available as part of the source (trunk/cgi-bin), but you are right: This no longer gets installed anywhere, and will only be available if you download or checkout the full source. A typical easy_install will not make the files available.

Following the migration to Setuptools, Trac no longer leaves copies of any resources outside the installed .egg - and only read-only runtime files are deployed there. cgi-bin, sample-plugins and contrib directories all behave this way. Unlike the old 'share' strategy, the .egg is a moving target and not suitable for keeping auxillary files used by other processes.

I agree that this can be a bit confusing, but not quite sure what to do about it. Improving documentation may help, as currently this switch is only documented in TracDev/ReleaseNotes/0.11 - mentioning new settings for shared config, plugins and templates.

In some form or another this should be clarified in soon-ish.

comment:4 Changed 9 years ago by edunne

yeah, well it was certainly a bit confusing.

It might be helpful to put a note on the

http://trac.edgewall.org/wiki/TracInstall the 0.11.x install guide where it talks about trac.cgi and Fast cgi to explain that trac.cgi is no longer included. And suggested steps to actually get TRAC running?

comment:5 Changed 8 years ago by tim

yes, i'm trying to setup trac 0.11 on IIS here, and it says map the vdir to cgi-bin ?! what do i do??

Changed 8 years ago by Dave Gynn <dgynn@…>

Attachment: trac-setup-data-files.dif added

patch to provide data_files for install_data

comment:6 Changed 8 years ago by Dave Gynn <dgynn@…>

Cc: dgynn@… added

I've attached a patch that identifies the data_files to be installed with python setup.py install_data. This creates the folder structure under /usr/share/trac that was created with the 0.10.x installer. The data files still don't appear to be installed by easy_install or setup.py install.

I included the layout.html template file in the patch. But now that I think about it theme.html might be better.

Changed 8 years ago by Dave Gynn <dgynn@…>

Attachment: trac-setup-data-files.diff added

updated patch with correct htdocs subdirectories

comment:7 Changed 8 years ago by osimons

This was fixed by [6894] before 0.11 release, and should be closed against that milestone (I don't have necessary permissions to select a closed milestone).

The short answer is to now run the command:

trac-admin /path/to/project deploy /my/output-dir

The default frontend files can then be found in output-dir/cgi-bin.

comment:8 Changed 8 years ago by Christian Boos

Milestone: 0.11.20.11
Resolution: fixed
Status: newclosed

comment:9 Changed 8 years ago by anonymous

Resolution: fixed
Status: closedreopened

Documentation needs to be updated to reflect this; without it, upgrading from .10 to .11 is a nightmare. Also, how do you deploy with multiple trac environments under a single directory?

$ trac-admin initenv /usr/local/trac/project1
$ trac-admin initenv /usr/local/trac/project2
$ trac-admin /usr/local/trac/project1 deploy /usr/share/trac
$ trac-admin /usr/local/trac/project2 deploy /usr/share/trac
Command Failed: Destination already exists. Remote and retry.

Lastly, using trac-admin deploy does not solve the problem because the cgi scripts it deploys are not executable.

[Wed Jul  2 17:50:35 2008] [error] [client 192.168.0.130] FastCGI: invalid (dynamic) server "/usr/share/trac/cgi-bin/trac.fcgi": access for server (uid 99, gid 99) not allowed: execute not allowed

comment:10 Changed 8 years ago by Piotr Kuczynski <piotr.kuczynski@…>

Component: generalweb frontend
Keywords: documentation added
Milestone: 0.11.1
Type: defecttask

comment:11 Changed 8 years ago by Noah Kantrowitz

Owner: changed from Jonas Borgström to Noah Kantrowitz
Status: reopenednew

comment:12 Changed 8 years ago by AndrejsC@…

Cc: AndrejsC@… added

Has anybody solved this with issue with multiple environments?

comment:13 Changed 8 years ago by anonymous

Resolution: fixed
Status: newclosed

comment:14 Changed 8 years ago by ebray

Resolution: fixed
Status: closedreopened

Random ticket butchering.

comment:15 Changed 8 years ago by anonymous

Resolution: fixed
Status: reopenedclosed

comment:16 Changed 8 years ago by anonymous

Resolution: fixed
Status: closedreopened

comment:17 Changed 8 years ago by anonymous

For multi-environment on apache & *nix:

You could try doing a 'deploy' once, for one environment, and then editing the resulting cgi-bin/trac.fcgi to remove the bits specific to that environment.

 # trac-admin /path/to/tracs/foo deploy /tmp/foo
 # vi /tmp/foo/cgi-bin/trac.fcgi

Note that this step can fail horribly due to old versions of the XmlRpcPlugin or CtxtNavAdd plugins. See ticket:4280.

Then copy the files generated by the 'deploy' command to the place that you already had specified in your apache config, e.g.

 # cp -r /tmp/foo/ /usr/share/
 # chown -R webserver:webgroup /usr/share/trac/{cgi-bin,htdocs}

It appears that in 0.11, for multi-environment the intention is that you put these generated files into /path/to/tracs/foo/cgi-bin and /path/to/tracs/foo/htdocs.

Perhaps this is going to produce more problems in upgrading to later releases? At the least, one will have to be religious about doing the 'deploy' on all tracs at upgrade time, so there is no "version skew".

comment:18 in reply to:  17 Changed 8 years ago by anonymous

doh.

>  # cp -r /tmp/foo/ /usr/share/
>  # chown -R webserver:webgroup /usr/share/trac/{cgi-bin,htdocs}
# cp -r /tmp/foo/* /usr/share/trac

comment:19 Changed 8 years ago by Christian Boos

Milestone: 0.11.20.11.3

Looks like it's (minimally) documented in TracCgi and TracModWSGI.

Is there anything more to add in the docs? (perhaps comment:17?)

comment:20 Changed 8 years ago by Christian Boos

Severity: blockernormal
Type: taskenhancement

A word about this in TracInstall seems useful though. Currently there's a warning pointing back to this ticket… not optimal.

comment:21 Changed 7 years ago by carsten.scheele@…

Severity: normalblocker
Type: enhancementtask

This problem totally killed me when I upgraded from Debian Etch to Lenny. Finding this bug report wasn't really easy: the hint in TracInstall is minimalistic.

comment:22 Changed 6 years ago by Christian Boos

Milestone: next-minor-0.12.x0.12

Seems everything is now documented for 0.12 in TracInstall#GeneratingtheTraccgi-bindirectory.

If there was anything else to do, please reopen.

comment:23 Changed 6 years ago by Remy Blank

Resolution: fixed
Status: reopenedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Noah Kantrowitz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Noah Kantrowitz to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.