Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#2395 closed defect (worksforme)

FastCGI : problem with project URL

Reported by: jouvin@… Owned by: Jonas Borgström
Priority: normal Milestone:
Component: general Version: 0.9
Severity: normal Keywords:
Cc: jouvin@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I have a strange behaviour with FastCGI.

I have set an URL to match one specific project with FastCGI with the following Apache config :

        Alias /lcg/chrome/site "/tmp_mnt/www/Web/servers/trac/site-config"
        Alias /lcg/chrome/common "/tmp_mnt/www/Web/servers/trac/new/share/trac/h
tdocs"
        ScriptAlias /lcg "/htdocs/tractest/bin/trac.fcgi"
        <Location "/lcg">
                SetEnv TRAC_ENV /projects/trac-new/LCGTier2
                SetEnv  PYTHONPATH /www/Web/servers/trac/new/lib/python2.4/site-
packages
                SetEnv PYTHON_EGG_CACHE /tmp/tractest/python-eggs-cache
        </Location>

If I enter url http://trac/lcg, I get the project list generated by trac.fcgi (I have specified TRAC_ENV and not TRAC_ENV_PARENT_DIR). If I click on one project (e.g. Test), I get url http://trac/lcg/Test but it works.

I also specified an url to match a multiproject parent path with the following config :

        Alias /tracf/chrome/common "/tmp_mnt/www/Web/servers/trac/new/share/trac
/htdocs"
        Alias /tracf/chrome/site "/tmp_mnt/www/Web/servers/trac/site-config"
        ScriptAlias /tracf "/htdocs/tractest/bin/trac.fcgi"
        <Location "/tracf">
                SetEnv TRAC_ENV_PARENT_DIR /projects/trac-new
                SetEnv  PYTHONPATH /www/Web/servers/trac/new/lib/python2.4/site/
packages
               SetEnv PYTHON_EGG_CACHE /tmp/tractest/python-eggs-cache
        </Location>

This one works properly. http://trac/tracf gives the project list and Test project is accessed under http://trac/tracf/Test.

Last I tried to set up project directly under / as we have done with CGI and mod_python. I used the following configuration :

        RewriteCond /projects/trac-new/$1              -d
        RewriteRule ^/([[:alnum:]]+)(/?.*)     %{DOCUMENT_ROOT}/bin/trac.fcgi$2
 [S=1,E=PYTHONPATH:/www/Web/servers/trac/new/lib/python2.4/site-packages,E=TRAC_
ENV_PARENT_DIR=/projects/trac-new,E=PYTHON_EGG_CACHE:/tmp/tractest/python-eggs-c
ache]

I get the same (mis)behaviour as with the first config (/lcg). If I enter http://trac/Test I get the project list and Test project under http://trac/Test/Test.

May be I did something wrong but I reread my config several times carefully and didn't find…

Michel

Attachments (0)

Change History (10)

comment:1 by anonymous, 18 years ago

Cc: jouvin@… added
Milestone: 0.9.1

I first tested with 0.9. Before filling this ticket, I upgraded to 0.9.1dev, source:/branches/0.9-stable#2544

comment:2 by Christopher Lenz, 18 years ago

Milestone: 0.9.10.9.2

comment:3 by Matthew Good, 18 years ago

Milestone: 0.9.3
Resolution: worksforme
Status: newclosed

Putting Trac at the root URL doesn't require any rewriting rules, instead use:

ScriptAlias / "/htdocs/tractest/bin/trac.fcgi"

I think that you also need to use the FastCgi directives to pass env vars instead of using SetEnv. See the examples in TracFastCgi, such as:

FastCgiConfig -initial-env TRAC_ENV=/path/to/env/trac

Also note that you don't need to Alias the /chrome paths with FastCGI, and it's probably better not to since your settings won't actually do anything with the multi-project setup.

comment:4 by jouvin@…, 18 years ago

Resolution: worksforme
Status: closedreopened

I made some new tests with FastCGI in multiproject config with projects rooted uner / URL. With some cleaning in my Apache virtual host configuration, I now have only the the following directive :

        ScriptAlias "/" "/htdocs/tractest/bin/trac.fcgi"

If I give the virtual host (http://tractest.lal.in2p3.fr) as URL, I get the project list. If I click on one project, I get a 'page not found' error. Looking at Apache logs, I find the following error (LCGTier2 is my project name) :

[Mon Jan 16 16:57:48 2006] [error] [client 134.158.72.114] script not found or unable to stat: /htdocs/tractest/bin/trac.fcgiLCGTier2, referer: https://tractest

If I use '/tracf' (or something else) as my project root URL, it works as expected. If I use single project under root, it also basically works (with some pbs to find css I didn't try to solve).

This is not clear for me where the pb lies.

The FastCGI configuration directive is :

     FastCgiServer /htdocs/tractest/bin/trac.fcgi -initial-env TRAC_ENV_PARENT_D
IR=/projects/trac-new -initial-env PYTHON_PATH=/www/Web/server/trac/new/lib/pyth
on2.4/site-packages -initial-env PYTHON_EGG_CACHE=/tmp/tractest/python-eggs-cach
e

comment:5 by anonymous, 18 years ago

Milestone: 0.9.4

comment:6 by Matthew Good, 18 years ago

Milestone: 0.9.4
Resolution: worksforme
Status: reopenedclosed

Use

ScriptAlias "/" "/htdocs/tractest/bin/trac.fcgi/"

Note the trailing "/" at the end to match the fact that the aliased path also ended with a "/".

This is really an installation support issue, so please use the MailingList or IrcChannel if you need further help.

comment:7 by Matthew Good, 18 years ago

Oops, I guess I left the trailing "/" out in my previous example. It's one of those Apache config quirks that's easy to forget.

comment:8 by jouvin@…, 18 years ago

Thank you very much. It works now. In fact I was remembering this trailing / issue but was not able to get the reference. And I was confused by your first example and the fact that it works without the trailing / if you have a /xxx URL.

Probably something to emphazise in TracCgi and/or TracFastCgi wiki pages. I reread them again but found no mention of that.

comment:9 by elmi, 18 years ago

Cc: abbdi_elmi@… added; jouvin@… removed
Component: generalsearch system
Keywords: studete added
Milestone: 0.7
Priority: normallowest
Severity: normaltrivial
Type: defecttask
Version: 0.90.8.2

[]

'

comment:10 by Christopher Lenz, 18 years ago

Cc: jouvin@… added; abbdi_elmi@… removed
Component: search systemgeneral
Keywords: studete removed
Milestone: 0.7
Priority: lowestnormal
Severity: trivialnormal
Type: taskdefect
Version: 0.8.20.9

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström 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.