Question

Apache logs - time setup different to server or php times

  • Posted November 14, 2014

Hoping someone can shed some light for me on a question I’ve been trying to answer now for days. I am running CentOS 6.5 x64 in Amsterdam using VestaCP and multiple WP sites without problem. My question is regarding the timestamp on the apache logs which is different to the server time and the php.ini time and here is an example

  1. [14/Nov/2014:08:47:09 -0500] apache log /var/log/httpd/access_log
  2. Fri Nov 14 14:47:09 CET 2014 ssl terminal command “date”
  3. 14:47:09 php command “echo date(‘H:i:s’);”

Item 1 is in fact one hour behind items 2 and 3 and looks to be timing from New York maybe and I appreciate the -0500 makes it GMT? Having set the timezones for Centos and also for php.ini for Amsterdam is there any way to to get item 1 to match them or at least to be in sync with them?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

How did you set the system time? I just did a little testing, and it seems that using tzselect will update the system time but Apache won’t reflect that. It is if I manually run:

ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime
service httpd restart

Most likely this is due to the init script starting Apache not reading the environmental variable from the user session.