[mod_python] mod_python modifies time zone of Apache child

Stephan Paukner paux at paukner.cc
Thu Aug 6 11:01:01 EDT 2009


I use Apache2 in MPM prefork mode. I noticed that if a specific Apache
child process handles a request to a roundup(.sf.net) tracker instance
via mod_python, the child's time zone is set to UTC, permanently. If any
other HTTP client gets to reuse that specific Apache child, the request
is still handled in UTC. This leads to times jumping between UTC and the
local timezone e.g. in a PHP-based calendar on the same site, depending
on the involved Apache child processes, what is quite annoying.

If I request the following URL sequence after an Apache restart:
then the "Current Time" indicated in the server-status shows e.g.
"03:13:37 CEST" (our local timezone) before and "01:13:37 UTC"
afterwards, because all three requests are obviously served by the same
Apache child. These jumping times also show up in the Apache logs.

This doesn't happen if I directly access the tracker via

I tried adding
    SetEnv TZ Europe/Vienna
at various places in our virtual host, but AFAIK these settings are only
read at the creation of a child process, not repeatedly. I don't know
how to set the timezone globally for all python instances on that host;
I set TZ in /etc/environment. I've set up the mod_python.testhandler
like suggested in the Troubleshooting section, and /mpinfo indeed shows
"TZ" with value "Europe/Vienna", but I can't see any time information in
that output.

All packages are from Debian amd64 Lenny. mod_python bindings for
roundup are just as suggested
in /usr/share/doc/roundup/examples/roundup_apache.

Any suggestions on how to explore this further? Do you need more config

Stephan Paukner <paux at paukner.cc>

More information about the Mod_python mailing list