SetEnv trac.locale "en_US.UTF-8"
but doesn't seem to have any effect. It also looks like the wsgi
script needs to be loaded with explicit os.environ settings to work.
My actual configuration:
# Define WSGI parameters
WSGIDaemonProcess wsgi-project user=www-data group=www-data threads=25
WSGIScriptAlias / /var/www/project/trac.wsgi
<Directory /var/www/project/trac/>
WSGIProcessGroup wsgi-project
WSGIApplicationGroup %{GLOBAL}
SetEnv trac.env_path /var/www/project/trac/
SetEnv trac.locale "en_US.UTF-8"
Order deny,allow
Allow from all
</Directory>
and the wsgi script contains:
import os
os.environ['TRAC_ENV'] = '/var/www/project/trac'
os.environ['PYTHON_EGG_CACHE'] = '/var/cache/python'
import trac.web.main
application = trac.web.main.dispatch_request
Looks like without the os.environ apache raises a 500 Internal Error,
and the log sais that Trac needs to have the environment variables set.
I would like to use only one of the two way, and have it working :-)
Ideas?
Thanks
ANdreaT
[Wed Jan 21 11:15:50 2009] [error] [client X.X.X.X] mod_wsgi
(pid=16999): Exception occurred processing WSGI script '/var/www/
project/trac.wsgi'., referer: https://localhost/admin/ticket/milestones
[Wed Jan 21 11:15:50 2009] [error] [client X.X.X.X] Traceback (most
recent call last):, referer: https:/
/localhost/admin/ticket/milestones
[Wed Jan 21 11:15:50 2009] [error] [client X.X.X.X] File "/usr/lib/
python2.5/site-packages/Trac-0.11.2
.1-py2.5.egg/trac/web/main.py", line 381, in dispatch_request,
referer: https://localhost/admin/ticket/milestones
[Wed Jan 21 11:15:50 2009] [error] [client X.X.X.X] raise
EnvironmentError('The environment options "TRAC_ENV" or ', referer: https://localhost/admin/ticket/milestones
[Wed Jan 21 11:15:50 2009] [error] [client X.X.X.X] EnvironmentError:
The environment options "TRAC_ENV" or "TRAC_ENV_PARENT_DIR" or the
mod_python options "TracEnv" or "TracEnvParentDir" are missing. Trac
requires
one of these options to locate the Trac environment(s)., referer: https://localhost/admin/ticket/milestones
> Graham
Thanks Graham :-)
Best
ANdreaT
> And what happens if you don't have a trailing slash on:
>
> SetEnv trac.env_path /var/www/project/trac/
>
> and leave out TRAC_ENV os.environ setting?
Same... same error, without slash and removing all the os.environ from
the WSGI script. I have also noticed that in the Trac wiki page for
wsgi is not at all mentioned to set environment variables for WSGI
using the mod_env (SetEnv directive). Is this something new that
requires a specific version of mod_wsgi? I am running debian lenny
with mod_wsgi 2.3.*
> Are you running mod_python with the same Apache or any other instance
> of Trac using either mod_python or mod_wsgi?
mod_python is not even installed :-)
> Graham
ANdreaT
> On Jan 23, 4:37 am, Andrea Tomasini <tumm...@gmail.com> wrote:
>
>> On 22 Jan, 2009, at 16:02 , Graham Dumpleton wrote:
>
> Use of SetEnv is mentioned in:
>
> http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac
>
> Any page on the Trac wiki isn't going to mention all different
> possible ways that mod_wsgi can be configured.
I figured it out, that's where I copied the configuration from...
> Trying using first recipe in section at:
>
> http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Tracking_Request_and_Response
>
> to wrap Trac application and verify what environment is being passed
> to Trac. If the correct environment is being passed, then something
> must be going wrong in Trac.
I tried it out... and beside logging a _lot_ there is actually no trac
or TRAC variable in there... even if the SetEnv is set in the
Directory section of the apache config.
> What version of Trac are you using?
Trac 0.11.2.1
Apache+mod_wsgi+python2.5 on debian lenny :-)
Thanks for your help
> Graham
ANdreaT
Hi Graham :-)
> I should have spotted it earlier. The following is wrong:
>
> <Directory /var/www/project/trac/>
>
> It should be:
>
> <Directory /var/www/project/>
>
> Because it was wrong you weren't even running in daemon mode but still
> in embedded mode.
Well this was it, now it works, also the locale settings ;-)
> BTW, the mod_wsgi documentation says to put the WSGI script file in a
> special subdirectory of its own, not in the parent directory to the
> Trac instance. A subdirectory is used so that you are not telling
> Apache that it could technically serve up files from your Trac
> instance. A misconfiguration of your server could at the moment
> technically allow people to download your Trac instance data because
> of security on the file system being too loose.
Fixed also this... thanks ;-)
> Graham
ANdreaT