#2395 closed defect (worksforme)
FastCGI : problem with project URL
Reported by: | 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 , 19 years ago
Cc: | added |
---|---|
Milestone: | → 0.9.1 |
comment:2 by , 19 years ago
Milestone: | 0.9.1 → 0.9.2 |
---|
comment:3 by , 19 years ago
Milestone: | 0.9.3 |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
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 , 19 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
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 , 19 years ago
Milestone: | → 0.9.4 |
---|
comment:6 by , 19 years ago
Milestone: | 0.9.4 |
---|---|
Resolution: | → worksforme |
Status: | reopened → closed |
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 , 19 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 , 19 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 , 19 years ago
Cc: | added; removed |
---|---|
Component: | general → search system |
Keywords: | studete added |
Milestone: | → 0.7 |
Priority: | normal → lowest |
Severity: | normal → trivial |
Type: | defect → task |
Version: | 0.9 → 0.8.2 |
[]
'
comment:10 by , 19 years ago
Cc: | added; removed |
---|---|
Component: | search system → general |
Keywords: | studete removed |
Milestone: | 0.7 |
Priority: | lowest → normal |
Severity: | trivial → normal |
Type: | task → defect |
Version: | 0.8.2 → 0.9 |
I first tested with 0.9. Before filling this ticket, I upgraded to 0.9.1dev, source:/branches/0.9-stable#2544