+ Responder ao Tópico



  1. #1
    ReiserFS
    Visitante

    Padrão Timezone no Apache

    Galera tou com um probleminha no apache, tipo ele não esta usando o mesmo timezone que a BOX, o date do meu linux esta certo, mas o do apache ta errado. Todos meus scripts em PHP mostram as horas erradas e no log tb, tudo com GMT +2, quando deveria ser -3, isso sendo +5 horas no server.

    Ja zuei todo google atras de algoe nao achei, nem no site do apache, eh muito estranho isso, fiz ate um teste digitando no console:

    php -r "echo date('d/m/Y h:i:s',time());"

    e da a hora certa, mas eu colocando esse comando em um file.php e executando no browser ele da gmt +2.

    Alguem tem alguma dica, tou com 2 servers assim.

    Curisoso: No apache WIN a hora ficar normal

    -----------------

    Outra duvida para nao abrir outro topico.

    Reparei que em alguns servidores de WEBHOSTING, o httpd roda sob o usuario da conta. EX:

    Tem 4 dominios no webhosting.

    www.d1.com
    www.d2.com
    www.d3.com
    www.d4.com

    Na listagem de processo cada um roda correspondende a o usuario (mesmo user OWNER da pasta onde esta os arquivos)

    No me caso o apache roda como u:apache e g:www

    Como eu faço pra rodar cada VHOST com usuario diferente?

    :wink:

  2. #2
    mrbits
    Visitante

    Padrão Re: Timezone no apache & Usuarios de Virtual Hosts

    Ola

    Vamos começar pelo ultimo topico: Usuarios nos VirtualHosts:
    Em teoria, dentro de um <VirtualHost></VirtualHost> voce pode ter um httpd.conf completo. Baseando-se nisso, voce pode usar as diretivas User e Group DENTRO de um VirtualHost. Veja o Exemplo

    <VirtualHost *>
    ServerName www.vhd1.com
    DocumentRoot /opt/vhosts/vhd1
    User vhd1
    Group vhd1
    </VirtualHost>

    ===============================================

    O segundo topico: Timezone no apache.


    Por favor, poste aqui o resultado de dois comandos:

    date
    zdump -v /etc/localtime

    Fico no aguardo

    Obrigado e um abraço

  3. #3
    ReiserFS
    Visitante

    Padrão Timezone no Apache

    Pow valeu a dica do Virtual Host heheeh legal D+ e facil (i love apache)

    Bom o zdump deu nisso tudo aki oh

    [size=9px]/etc/localtime Fri Dec 13 20:45:52 1901 UTC = Fri Dec 13 18:23:00 1901 BRT isdst=0 gmtoff=-8572
    /etc/localtime Sat Dec 14 20:45:52 1901 UTC = Sat Dec 14 18:23:00 1901 BRT isdst=0 gmtoff=-8572
    /etc/localtime Thu Jan 1 02:22:51 1914 UTC = Wed Dec 31 23:59:59 1913 BRT isdst=0 gmtoff=-8572
    /etc/localtime Thu Jan 1 02:22:52 1914 UTC = Wed Dec 31 23:22:52 1913 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sat Oct 3 13:59:59 1931 UTC = Sat Oct 3 10:59:59 1931 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sat Oct 3 14:00:00 1931 UTC = Sat Oct 3 12:00:00 1931 BRST isdst=1 gmtoff=-7200
    /etc/localtime Fri Apr 1 01:59:59 1932 UTC = Thu Mar 31 23:59:59 1932 BRST isdst=1 gmtoff=-7200
    /etc/localtime Fri Apr 1 02:00:00 1932 UTC = Thu Mar 31 23:00:00 1932 BRT isdst=0 gmtoff=-10800
    /etc/localtime Mon Oct 3 02:59:59 1932 UTC = Sun Oct 2 23:59:59 1932 BRT isdst=0 gmtoff=-10800
    /etc/localtime Mon Oct 3 03:00:00 1932 UTC = Mon Oct 3 01:00:00 1932 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sat Apr 1 01:59:59 1933 UTC = Fri Mar 31 23:59:59 1933 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sat Apr 1 02:00:00 1933 UTC = Fri Mar 31 23:00:00 1933 BRT isdst=0 gmtoff=-10800
    /etc/localtime Thu Dec 1 02:59:59 1949 UTC = Wed Nov 30 23:59:59 1949 BRT isdst=0 gmtoff=-10800
    /etc/localtime Thu Dec 1 03:00:00 1949 UTC = Thu Dec 1 01:00:00 1949 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Apr 16 02:59:59 1950 UTC = Sun Apr 16 00:59:59 1950 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Apr 16 03:00:00 1950 UTC = Sun Apr 16 00:00:00 1950 BRT isdst=0 gmtoff=-10800
    /etc/localtime Fri Dec 1 02:59:59 1950 UTC = Thu Nov 30 23:59:59 1950 BRT isdst=0 gmtoff=-10800
    /etc/localtime Fri Dec 1 03:00:00 1950 UTC = Fri Dec 1 01:00:00 1950 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Apr 1 01:59:59 1951 UTC = Sat Mar 31 23:59:59 1951 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Apr 1 02:00:00 1951 UTC = Sat Mar 31 23:00:00 1951 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sat Dec 1 02:59:59 1951 UTC = Fri Nov 30 23:59:59 1951 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sat Dec 1 03:00:00 1951 UTC = Sat Dec 1 01:00:00 1951 BRST isdst=1 gmtoff=-7200
    /etc/localtime Tue Apr 1 01:59:59 1952 UTC = Mon Mar 31 23:59:59 1952 BRST isdst=1 gmtoff=-7200
    /etc/localtime Tue Apr 1 02:00:00 1952 UTC = Mon Mar 31 23:00:00 1952 BRT isdst=0 gmtoff=-10800
    /etc/localtime Mon Dec 1 02:59:59 1952 UTC = Sun Nov 30 23:59:59 1952 BRT isdst=0 gmtoff=-10800
    /etc/localtime Mon Dec 1 03:00:00 1952 UTC = Mon Dec 1 01:00:00 1952 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Mar 1 01:59:59 1953 UTC = Sat Feb 28 23:59:59 1953 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Mar 1 02:00:00 1953 UTC = Sat Feb 28 23:00:00 1953 BRT isdst=0 gmtoff=-10800
    /etc/localtime Mon Dec 9 02:59:59 1963 UTC = Sun Dec 8 23:59:59 1963 BRT isdst=0 gmtoff=-10800
    /etc/localtime Mon Dec 9 03:00:00 1963 UTC = Mon Dec 9 01:00:00 1963 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Mar 1 01:59:59 1964 UTC = Sat Feb 29 23:59:59 1964 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Mar 1 02:00:00 1964 UTC = Sat Feb 29 23:00:00 1964 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sun Jan 31 02:59:59 1965 UTC = Sat Jan 30 23:59:59 1965 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sun Jan 31 03:00:00 1965 UTC = Sun Jan 31 01:00:00 1965 BRST isdst=1 gmtoff=-7200
    /etc/localtime Wed Mar 31 01:59:59 1965 UTC = Tue Mar 30 23:59:59 1965 BRST isdst=1 gmtoff=-7200
    /etc/localtime Wed Mar 31 02:00:00 1965 UTC = Tue Mar 30 23:00:00 1965 BRT isdst=0 gmtoff=-10800
    /etc/localtime Wed Dec 1 02:59:59 1965 UTC = Tue Nov 30 23:59:59 1965 BRT isdst=0 gmtoff=-10800
    /etc/localtime Wed Dec 1 03:00:00 1965 UTC = Wed Dec 1 01:00:00 1965 BRST isdst=1 gmtoff=-7200
    /etc/localtime Tue Mar 1 01:59:59 1966 UTC = Mon Feb 28 23:59:59 1966 BRST isdst=1 gmtoff=-7200
    /etc/localtime Tue Mar 1 02:00:00 1966 UTC = Mon Feb 28 23:00:00 1966 BRT isdst=0 gmtoff=-10800
    /etc/localtime Tue Nov 1 02:59:59 1966 UTC = Mon Oct 31 23:59:59 1966 BRT isdst=0 gmtoff=-10800
    /etc/localtime Tue Nov 1 03:00:00 1966 UTC = Tue Nov 1 01:00:00 1966 BRST isdst=1 gmtoff=-7200
    /etc/localtime Wed Mar 1 01:59:59 1967 UTC = Tue Feb 28 23:59:59 1967 BRST isdst=1 gmtoff=-7200
    /etc/localtime Wed Mar 1 02:00:00 1967 UTC = Tue Feb 28 23:00:00 1967 BRT isdst=0 gmtoff=-10800
    /etc/localtime Wed Nov 1 02:59:59 1967 UTC = Tue Oct 31 23:59:59 1967 BRT isdst=0 gmtoff=-10800
    /etc/localtime Wed Nov 1 03:00:00 1967 UTC = Wed Nov 1 01:00:00 1967 BRST isdst=1 gmtoff=-7200
    /etc/localtime Fri Mar 1 01:59:59 1968 UTC = Thu Feb 29 23:59:59 1968 BRST isdst=1 gmtoff=-7200
    /etc/localtime Fri Mar 1 02:00:00 1968 UTC = Thu Feb 29 23:00:00 1968 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sat Nov 2 02:59:59 1985 UTC = Fri Nov 1 23:59:59 1985 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sat Nov 2 03:00:00 1985 UTC = Sat Nov 2 01:00:00 1985 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sat Mar 15 01:59:59 1986 UTC = Fri Mar 14 23:59:59 1986 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sat Mar 15 02:00:00 1986 UTC = Fri Mar 14 23:00:00 1986 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sat Oct 25 02:59:59 1986 UTC = Fri Oct 24 23:59:59 1986 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sat Oct 25 03:00:00 1986 UTC = Sat Oct 25 01:00:00 1986 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sat Feb 14 01:59:59 1987 UTC = Fri Feb 13 23:59:59 1987 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sat Feb 14 02:00:00 1987 UTC = Fri Feb 13 23:00:00 1987 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sun Oct 25 02:59:59 1987 UTC = Sat Oct 24 23:59:59 1987 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sun Oct 25 03:00:00 1987 UTC = Sun Oct 25 01:00:00 1987 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Feb 7 01:59:59 1988 UTC = Sat Feb 6 23:59:59 1988 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Feb 7 02:00:00 1988 UTC = Sat Feb 6 23:00:00 1988 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sun Oct 16 02:59:59 1988 UTC = Sat Oct 15 23:59:59 1988 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sun Oct 16 03:00:00 1988 UTC = Sun Oct 16 01:00:00 1988 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Jan 29 01:59:59 1989 UTC = Sat Jan 28 23:59:59 1989 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Jan 29 02:00:00 1989 UTC = Sat Jan 28 23:00:00 1989 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sun Oct 15 02:59:59 1989 UTC = Sat Oct 14 23:59:59 1989 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sun Oct 15 03:00:00 1989 UTC = Sun Oct 15 01:00:00 1989 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Feb 11 01:59:59 1990 UTC = Sat Feb 10 23:59:59 1990 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Feb 11 02:00:00 1990 UTC = Sat Feb 10 23:00:00 1990 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sun Oct 15 02:59:59 1995 UTC = Sat Oct 14 23:59:59 1995 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sun Oct 15 03:00:00 1995 UTC = Sun Oct 15 01:00:00 1995 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Feb 11 01:59:59 1996 UTC = Sat Feb 10 23:59:59 1996 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Feb 11 02:00:00 1996 UTC = Sat Feb 10 23:00:00 1996 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sun Oct 3 02:59:59 1999 UTC = Sat Oct 2 23:59:59 1999 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sun Oct 3 03:00:00 1999 UTC = Sun Oct 3 01:00:00 1999 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Feb 27 01:59:59 2000 UTC = Sat Feb 26 23:59:59 2000 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Feb 27 02:00:00 2000 UTC = Sat Feb 26 23:00:00 2000 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sun Oct 8 02:59:59 2000 UTC = Sat Oct 7 23:59:59 2000 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sun Oct 8 03:00:00 2000 UTC = Sun Oct 8 01:00:00 2000 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Oct 22 01:59:59 2000 UTC = Sat Oct 21 23:59:59 2000 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Oct 22 02:00:00 2000 UTC = Sat Oct 21 23:00:00 2000 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sun Oct 14 02:59:59 2001 UTC = Sat Oct 13 23:59:59 2001 BRT isdst=0 gmtoff=-10800
    /etc/localtime Sun Oct 14 03:00:00 2001 UTC = Sun Oct 14 01:00:00 2001 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Feb 17 01:59:59 2002 UTC = Sat Feb 16 23:59:59 2002 BRST isdst=1 gmtoff=-7200
    /etc/localtime Sun Feb 17 02:00:00 2002 UTC = Sat Feb 16 23:00:00 2002 BRT isdst=0 gmtoff=-10800
    /etc/localtime Mon Jan 18 03:14:07 2038 UTC = Mon Jan 18 00:14:07 2038 BRT isdst=0 gmtoff=-10800
    /etc/localtime Tue Jan 19 03:14:07 2038 UTC = Tue Jan 19 00:14:07 2038 BRT isdst=0 gmtoff=-10800[/size]

  4. #4
    mrbits
    Visitante

    Padrão Re: Timezone no apache & Usuarios de Virtual Hosts

    Bom saber que as alteracoes no apache deram resultado...

    Qual sua distribuicao ? Aparentemente voce esta com suas bibliotecas de timezone bem desatualizadas e deve ter modificado a hora do seu servidor "na mao".

    Faça duas coisas:
    1) Consiga um arquivo de timezone atual e copie-o para /etc/localtime
    2) Utilize um NTP server para atualizar a hora do seu sistema. Eu utilizo um cara que sempre esta no ar, de uns conhecidos meus da alemanha: ntp0.fau.de. Por exemplo, coloque no seu crontab ( crontab -e ) uma linha +- assim:
    00 0/6 * * * /usr/sbin/ntpdate -s ntp0.fau.de ; /sbin/hwclock -w

    Isso fará com que, a cada 6 horas, o seu computador conecte-se a um time server e atualize tanto a hora do sistema quanto a hora do relogio da BIOS.

    Me conta o que aconteceu

    Um abraço

  5. #5
    ReiserFS
    Visitante

    Padrão Timezone no Apache

    Tou usando slack 9.1, mas tipo pq o apache simplesmente nao pega a hora da BIOS? no caso do linux. que estranho isso. vou atualizar com um servidor windows q tenho q ele atualiza por gps nao sei onde ehehe.

    vo testar e posto aki os results

    o localtime se refere ao zoneinfo, que faz parte do glibc meu glibc eh o padrao do slack 9.1

    glibc-2.3.2-i486-1

  6. #6
    ReiserFS
    Visitante

    Padrão Timezone no Apache

    humm nao funcionou. : /

    tipo o apache deve ter algo nele configurado o GMT +0200

    deve ter alguma funcao que eu mude isso pra -0300

    Ja tou dessistindo eheheh.

  7. #7
    ReiserFS
    Visitante

    Padrão Timezone no Apache

    Sobre o VirtualHosts, por usuario, aquilo nao funfa, pq eu uso apache2

    entao tenho que usar isso (creio)

    SuexecUserGroup nobody nogroup

    ---------------
    Special note: Use of this directive in <VirtualHost> is no longer supported. To configure your server for suexec use SuexecUserGroup.
    --------------

    Mesmo assim valeu!!