Re: Datetime and apache log files show wrong timezone

2009-01-24 Thread Graham Dumpleton



On Jan 25, 2:27 am, simong  wrote:
> On Jan 24, 2:30 pm, Graham Dumpleton 
> wrote:
>
>
>
> > On Jan 24, 8:46 pm, simong  wrote:
>
> > > My apologies in advance if this isn't a direct django issue but I
> > > can't work out where the problem is coming from.
>
> > > My server's system time runs Centos 5 and is set to Europe/London:
>
> > > -bash-3.2$ date
> > > Sat Jan 24 12:26:14 GMT 2009
> > > -bash-3.2$ date -u
> > > Sat Jan 24 12:26:17 UTC 2009
> > > -bash-3.2$ /sbin/hwclock --show
> > > Sat 24 Jan 2009 12:31:34 PM GMT  -0.984663 seconds
>
> > > /etc/sysconfig/clock is set thusly:
>
> > > ZONE="Europe/London"
> > > UTC=true
> > > ARC=false
>
> > > My django application timezone is set to 'Europe/London':
>
> > > TIME_ZONE = 'Europe/London'
>
> > > The application creates a datestamp to log when an order has been
> > > requested using datetime.datetime.now() but it and the apache logs are
> > > still using EST, which was what the machine was set to on build (no
> > > idea why, it's based in Germany):
>
> > > xxx.xxx.xxx.xxx - - [24/Jan/2009:07:16:19 -0500] "GET /media/images/
> > > bground_bottom_right.png HTTP/1.1" 200 116555 
> > > "http://www.popfood.co.uk/media/css/common.css; "Mozilla/5.0 (Macintosh; 
> > > U;
> > > Intel Mac OS X 10.5; en-US; rv:1.9.0.5) Gecko/2008120121 Firefox/3.0.5
> > > Ubiquity/0.1.5"
>
> > > The server has a Plesk control panel which provides a editable
> > > configuration file for the domain called vhost.conf which should
> > > override anything in the Plesk-generated config files, so I have
> > > added
> > > SetEnv TZ Europe/London to that and restarted apache to no effect.
>
> > That will not do anything as it only modified process environment
> > variables for CGI script processes execed from Apache.
>
> > If you are seeing the wrong timzone from what you are setting, it is
> > most likely because you are running multiple applications in same
> > Apache instance and each is wanting to use a different timezone. These
> > could be multiple Django instances, or even PHP applications.
>
> > Short answer is you can't run multiple applications in same Apache
> > which have different timezone requirements.
>
> > Graham
>
> For your information SetEnv does work in mod_python. It is referred to
> in the djangoproject documentation for setting up a server using
> mod_python 
> here:http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#howt...

I am talking about Apache/mod_python alone, where my statement is
correct.

That SetEnv does that for Django is a hack and works because Django
mod_python adapter updates os.environ from mod_python
req.subprocess_env. That it does this is quite evil because it
actually affects the whole process environment variable set and not
that for just that specific Django instance of URL subset as bounded
by any Location directive in Apache. If you have multiple Django
instances, use SetEnv can cross pollute the process environment
variables seen by each, which in some circumstances can cause
problems. It will also infect process environment variables as seen by
PHP applications if running in same Apache instance.

Graham



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Datetime and apache log files show wrong timezone

2009-01-24 Thread simong



On Jan 24, 2:30 pm, Graham Dumpleton 
wrote:
> On Jan 24, 8:46 pm, simong  wrote:
>
>
>
> > My apologies in advance if this isn't a direct django issue but I
> > can't work out where the problem is coming from.
>
> > My server's system time runs Centos 5 and is set to Europe/London:
>
> > -bash-3.2$ date
> > Sat Jan 24 12:26:14 GMT 2009
> > -bash-3.2$ date -u
> > Sat Jan 24 12:26:17 UTC 2009
> > -bash-3.2$ /sbin/hwclock --show
> > Sat 24 Jan 2009 12:31:34 PM GMT  -0.984663 seconds
>
> > /etc/sysconfig/clock is set thusly:
>
> > ZONE="Europe/London"
> > UTC=true
> > ARC=false
>
> > My django application timezone is set to 'Europe/London':
>
> > TIME_ZONE = 'Europe/London'
>
> > The application creates a datestamp to log when an order has been
> > requested using datetime.datetime.now() but it and the apache logs are
> > still using EST, which was what the machine was set to on build (no
> > idea why, it's based in Germany):
>
> > xxx.xxx.xxx.xxx - - [24/Jan/2009:07:16:19 -0500] "GET /media/images/
> > bground_bottom_right.png HTTP/1.1" 200 116555 
> > "http://www.popfood.co.uk/media/css/common.css; "Mozilla/5.0 (Macintosh; U;
> > Intel Mac OS X 10.5; en-US; rv:1.9.0.5) Gecko/2008120121 Firefox/3.0.5
> > Ubiquity/0.1.5"
>
> > The server has a Plesk control panel which provides a editable
> > configuration file for the domain called vhost.conf which should
> > override anything in the Plesk-generated config files, so I have
> > added
> > SetEnv TZ Europe/London to that and restarted apache to no effect.
>
> That will not do anything as it only modified process environment
> variables for CGI script processes execed from Apache.
>
> If you are seeing the wrong timzone from what you are setting, it is
> most likely because you are running multiple applications in same
> Apache instance and each is wanting to use a different timezone. These
> could be multiple Django instances, or even PHP applications.
>
> Short answer is you can't run multiple applications in same Apache
> which have different timezone requirements.
>
> Graham
>

For your information SetEnv does work in mod_python. It is referred to
in the djangoproject documentation for setting up a server using
mod_python here: 
http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#howto-deployment-modpython

Simon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Datetime and apache log files show wrong timezone

2009-01-24 Thread simong



On Jan 24, 2:30 pm, Graham Dumpleton 
wrote:
> On Jan 24, 8:46 pm, simong  wrote:
>
>
>
> > My apologies in advance if this isn't a direct django issue but I
> > can't work out where the problem is coming from.
>
> > My server's system time runs Centos 5 and is set to Europe/London:
>
> > -bash-3.2$ date
> > Sat Jan 24 12:26:14 GMT 2009
> > -bash-3.2$ date -u
> > Sat Jan 24 12:26:17 UTC 2009
> > -bash-3.2$ /sbin/hwclock --show
> > Sat 24 Jan 2009 12:31:34 PM GMT  -0.984663 seconds
>
> > /etc/sysconfig/clock is set thusly:
>
> > ZONE="Europe/London"
> > UTC=true
> > ARC=false
>
> > My django application timezone is set to 'Europe/London':
>
> > TIME_ZONE = 'Europe/London'
>
> > The application creates a datestamp to log when an order has been
> > requested using datetime.datetime.now() but it and the apache logs are
> > still using EST, which was what the machine was set to on build (no
> > idea why, it's based in Germany):
>
> > xxx.xxx.xxx.xxx - - [24/Jan/2009:07:16:19 -0500] "GET /media/images/
> > bground_bottom_right.png HTTP/1.1" 200 116555 
> > "http://www.popfood.co.uk/media/css/common.css; "Mozilla/5.0 (Macintosh; U;
> > Intel Mac OS X 10.5; en-US; rv:1.9.0.5) Gecko/2008120121 Firefox/3.0.5
> > Ubiquity/0.1.5"
>
> > The server has a Plesk control panel which provides a editable
> > configuration file for the domain called vhost.conf which should
> > override anything in the Plesk-generated config files, so I have
> > added
> > SetEnv TZ Europe/London to that and restarted apache to no effect.
>
> That will not do anything as it only modified process environment
> variables for CGI script processes execed from Apache.
>
> If you are seeing the wrong timzone from what you are setting, it is
> most likely because you are running multiple applications in same
> Apache instance and each is wanting to use a different timezone. These
> could be multiple Django instances, or even PHP applications.
>
> Short answer is you can't run multiple applications in same Apache
> which have different timezone requirements.
>
> Graham
>

Nope, there is one other django application running on the server and
it's set to Europe/London too. There's nothing else on the machine
that uses any scripting.

A further search suggests setting a PythonOption for mod_python might
work.

Simon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Datetime and apache log files show wrong timezone

2009-01-24 Thread Graham Dumpleton



On Jan 24, 8:46 pm, simong  wrote:
> My apologies in advance if this isn't a direct django issue but I
> can't work out where the problem is coming from.
>
> My server's system time runs Centos 5 and is set to Europe/London:
>
> -bash-3.2$ date
> Sat Jan 24 12:26:14 GMT 2009
> -bash-3.2$ date -u
> Sat Jan 24 12:26:17 UTC 2009
> -bash-3.2$ /sbin/hwclock --show
> Sat 24 Jan 2009 12:31:34 PM GMT  -0.984663 seconds
>
> /etc/sysconfig/clock is set thusly:
>
> ZONE="Europe/London"
> UTC=true
> ARC=false
>
> My django application timezone is set to 'Europe/London':
>
> TIME_ZONE = 'Europe/London'
>
> The application creates a datestamp to log when an order has been
> requested using datetime.datetime.now() but it and the apache logs are
> still using EST, which was what the machine was set to on build (no
> idea why, it's based in Germany):
>
> xxx.xxx.xxx.xxx - - [24/Jan/2009:07:16:19 -0500] "GET /media/images/
> bground_bottom_right.png HTTP/1.1" 200 116555 
> "http://www.popfood.co.uk/media/css/common.css; "Mozilla/5.0 (Macintosh; U;
> Intel Mac OS X 10.5; en-US; rv:1.9.0.5) Gecko/2008120121 Firefox/3.0.5
> Ubiquity/0.1.5"
>
> The server has a Plesk control panel which provides a editable
> configuration file for the domain called vhost.conf which should
> override anything in the Plesk-generated config files, so I have
> added
> SetEnv TZ Europe/London to that and restarted apache to no effect.

That will not do anything as it only modified process environment
variables for CGI script processes execed from Apache.

If you are seeing the wrong timzone from what you are setting, it is
most likely because you are running multiple applications in same
Apache instance and each is wanting to use a different timezone. These
could be multiple Django instances, or even PHP applications.

Short answer is you can't run multiple applications in same Apache
which have different timezone requirements.

Graham

> I built python 2.5.2 by hand on the server as it came with 2.4 so I am
> wondering if the timezone is statically set somewhere in either the
> python or apache build, but does anyone have any other suggestions
> related to django, python or apache as to why I can't override the
> timezone setting?
>
> Thanks
> Simon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Datetime and apache log files show wrong timezone

2009-01-24 Thread simong

My apologies in advance if this isn't a direct django issue but I
can't work out where the problem is coming from.

My server's system time runs Centos 5 and is set to Europe/London:

-bash-3.2$ date
Sat Jan 24 12:26:14 GMT 2009
-bash-3.2$ date -u
Sat Jan 24 12:26:17 UTC 2009
-bash-3.2$ /sbin/hwclock --show
Sat 24 Jan 2009 12:31:34 PM GMT  -0.984663 seconds

/etc/sysconfig/clock is set thusly:

ZONE="Europe/London"
UTC=true
ARC=false


My django application timezone is set to 'Europe/London':

TIME_ZONE = 'Europe/London'

The application creates a datestamp to log when an order has been
requested using datetime.datetime.now() but it and the apache logs are
still using EST, which was what the machine was set to on build (no
idea why, it's based in Germany):

xxx.xxx.xxx.xxx - - [24/Jan/2009:07:16:19 -0500] "GET /media/images/
bground_bottom_right.png HTTP/1.1" 200 116555 "http://
www.popfood.co.uk/media/css/common.css" "Mozilla/5.0 (Macintosh; U;
Intel Mac OS X 10.5; en-US; rv:1.9.0.5) Gecko/2008120121 Firefox/3.0.5
Ubiquity/0.1.5"

The server has a Plesk control panel which provides a editable
configuration file for the domain called vhost.conf which should
override anything in the Plesk-generated config files, so I have
added
SetEnv TZ Europe/London to that and restarted apache to no effect.

I built python 2.5.2 by hand on the server as it came with 2.4 so I am
wondering if the timezone is statically set somewhere in either the
python or apache build, but does anyone have any other suggestions
related to django, python or apache as to why I can't override the
timezone setting?

Thanks
Simon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---