This is a discussion on Multiple time zones 1 server? within the Linux General forums, part of the Linux Forums category; Hi people, I have an interesting conundrum. We run as a small ISP for clients as a side business. We ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi people,
I have an interesting conundrum. We run as a small ISP for clients as a side business. We have a single server that does everything running RH7.2. it runs DNS, mail, web, webmail, java, tomcat, database etc etc. The boss sent an email yesterday asking id we could use GMT for our clients overseas and stay local time for our clients in oz. This is a valid enough request. The people in england want to see their reports etc in their time and the clients in oz want the same. If I ask the question of people I know I get "Use UTC and everone can just cope". Is there a solution to this problem or do people just run another box for this kind of situation. Thinking about it it seems that you would have to run little virtual servers or different boxes. Is this actually the case or is there something out there already that solves this problem. I have been looking in lots of places and can't seem to find any good answers. Thanks in advance Graham |
|
|||
|
On Mon, 28 Jul 2003, graham Dinning <gdinning@resmaster.com> wrote:
> Hi people, > I have an interesting conundrum. We run as a small ISP for clients as a > side business. > We have a single server that does everything running RH7.2. it runs DNS, > mail, web, webmail, java, tomcat, database etc etc. > The boss sent an email yesterday asking id we could use GMT for our > clients overseas and stay local time for our clients in oz. > This is a valid enough request. > The people in england want to see their reports etc in their time and the > clients in oz want the same. > If I ask the question of people I know I get "Use UTC and everone can just > cope". > > Is there a solution to this problem or do people just run another box for > this kind of situation. Thinking about it it seems that you would have to > run little virtual servers or different boxes. > Is this actually the case or is there something out there already that > solves this problem. I have been looking in lots of places and can't seem to > find any good answers. > > Thanks in advance > Graham I help someone with a virtual host on FreeBSD 4.4-RELEASE. Apache and sendmail run within their home dir (chroot jail). But that requires that all necessary binaries, libs, perl, etc. be within the chroot jail. When logged into the shell, it is not within the virtual jail, but a virtual command can be used to test things there. For example: % date Mon Jul 28 01:58:12 GMT 2003 % virtual date Sun Jul 27 20:58:24 CDT 2003 So apache and sendmail logs would be in the user's timezone. Time zone could also possibly be set in the user's login shell if the system is set up properly for that. Just an example of how setting timezone (TZ) in environment affects date: #!/bin/sh date export TZ="UTC" date export TZ="PST8PDT" date prints: Sun Jul 27 21:11:31 CDT 2003 Mon Jul 28 02:11:31 UTC 2003 Sun Jul 27 19:11:31 PDT 2003 -- David Efflandt - All spam ignored http://www.de-srv.com/ http://www.autox.chicago.il.us/ http://www.berniesfloral.net/ http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/ |
|
|||
|
In article <3f2470d8$0$95050$c30e37c6@lon-reader.news.telstra.net>,
graham Dinning <gdinning@resmaster.com> wrote: >Hi people, > I have an interesting conundrum. We run as a small ISP for clients as a >side business. >We have a single server that does everything running RH7.2. it runs DNS, >mail, web, webmail, java, tomcat, database etc etc. > The boss sent an email yesterday asking id we could use GMT for our >clients overseas and stay local time for our clients in oz. >This is a valid enough request. >The people in england want to see their reports etc in their time and the >clients in oz want the same. >If I ask the question of people I know I get "Use UTC and everone can just >cope". The normal way of working is that the box uses GMT/UTC internally and then date-times are presented to users in the format they expect. (Bear in mind that this is purely a presentation issue.) What sort of applications are your users running to generate these reports? Can they not just get different TZ settings as they log in? John -- The Linux Emporium - the source for Linux in the UK See http://www.linuxemporium.co.uk/ We had a woodhenge here once but it rotted. |
|
|||
|
graham Dinning <gdinning@resmaster.com> wrote:
> The boss sent an email yesterday asking id we could use GMT for our > clients overseas and stay local time for our clients in oz. Yes... > This is a valid enough request. > The people in england want to see their reports etc in their time and the > clients in oz want the same. > If I ask the question of people I know I get "Use UTC and everone can just > cope". The normal approach is to run the server in UTC and then set the timezone appropriately for different users. For example, in the UK the timezone should be "GB-Eire". For folks in Queensland, I believe the correct timezone would be "Australia/Queensland". You can look in /usr/share/zoneinfo for more time zone labels. Consider: $ TZ=Australia/Queensland date Mon Jul 28 20:53:30 EST 2003 $ TZ=GB-Eire date # UK; also Europe/London Mon Jul 28 11:53:30 BST 2003 $ TZ=Europe/Paris date # France Mon Jul 28 12:53:30 CEST 2003 $ TZ=EST5EDT date # USA Eastern; also America/New_York Mon Jul 28 06:53:30 EDT 2003 All are correct, and all represent the same instant in time. Chris -- @s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l} |
|
|||
|
The default time is created from a file /etc/localtime. This is
a copy or symlink to one of the timezone files in /usr/share/timezone. These are compiled timezone files (from "zic"). For users not using the default, the TZ environment variable should be set and exported in their login script. I don't know how you can make apache sensitive to timezones, but you can get close enough for your particular situation. Apache can be made to return different pages depending on the "locale" of the client's browser. You can have different clients map to different URLs or CGIs, which can then set TZ in their environment. Hope this helps! -Wayne P.S. When I worked for Bell Labs in the early 1980s, the time zone was compiled into the kernel! To change the timezone meant to recompile the kernel, and there was only a single zone for all users. All commercial Unixes at the time came with enough .o files and source to change the zone and rebuild the kernel! graham Dinning wrote: > Hi people, > I have an interesting conundrum. We run as a small ISP for clients as a > side business. > We have a single server that does everything running RH7.2. it runs DNS, > mail, web, webmail, java, tomcat, database etc etc. > The boss sent an email yesterday asking id we could use GMT for our > clients overseas and stay local time for our clients in oz. > This is a valid enough request. > The people in england want to see their reports etc in their time and the > clients in oz want the same. > If I ask the question of people I know I get "Use UTC and everone can just > cope". > > Is there a solution to this problem or do people just run another box for > this kind of situation. Thinking about it it seems that you would have to > run little virtual servers or different boxes. > Is this actually the case or is there something out there already that > solves this problem. I have been looking in lots of places and can't seem to > find any good answers. > > Thanks in advance > Graham > > |
|
|||
|
Steffen writes:
> That is correct. However, with webservers creating HTML on the fly, you > have the problem that the server doesn't know which timezone presentation > to generate for the client. The server should send UTC or local time with offset and the client should translate it appropriately. -- John Hasler john@dhh.gt.org Dancing Horse Hill Elmwood, Wisconsin |
|
|||
|
According to John Hasler <john@dhh.gt.org>:
>The server should send UTC or local time with offset and the client should >translate it appropriately. Ah, as I said, I'm quite oblivious to HTML. So there is tag for date/time that is to be interpreted by the client? Cheers Steffen. |
|
|||
|
I wrote:
> The server should send UTC or local time with offset and the client > should translate it appropriately. Steffen writes: > Ah, as I said, I'm quite oblivious to HTML. So there is tag for date/time > that is to be interpreted by the client? No, but there should be. -- John Hasler john@dhh.gt.org Dancing Horse Hill Elmwood, Wisconsin |
|
|||
|
On Tue, 29 Jul 2003 12:38:06 +0000, Steffen Kluge wrote:
> According to John Winters <john@linuxemporium.co.uk>: >>The normal way of working is that the box uses GMT/UTC internally and >>then date-times are presented to users in the format they expect. (Bear >>in mind that this is purely a presentation issue.) > > That is correct. However, with webservers creating HTML on the > fly, you have the problem that the server doesn't know which > timezone presentation to generate for the client. > > I'm no HTTP expert, but I don't think it caters for that yet. > Things like this should be communicated from client to server, > for example as parameter to the HEAD command. Till then, one > has to pull tricks. This can be stored/retrieved using a cookie, or using a GET or POST parameter to whatever CGI script generates the output. I don't see what's special about timezone in this respect; am I missing something? |
|
|||
|
According to Ed Murphy <emurphy42@socal.rr.com>:
>This can be stored/retrieved using a cookie, or using a GET or POST >parameter to whatever CGI script generates the output. I don't see >what's special about timezone in this respect; am I missing something? Cookies just store information at the client for later retrieval by the server. There doesn't seem to be a standardised mechanism for asking the client "what timezone are you in?". Any self-respecting client wouldn't appreciate such interrogation anyway, that's why a tagged date/time format is preferable. Cheers Steffen. |