• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 315
  • Last Modified:

What could cause system date on our Apache web server to suddenly change back 2 days?

Noticed this morning some reports that clearly ran this morning (August 7) were dated August 5 by a php cron job. We (hopefully) are aware of all code added to the Apache server. We know of no code added to the system that changes the system date, but have added php code that only reads the system date.

Have you seen this happen before?
Is there a way we can determine what changed the system date and how?
What can we do to prevent this from happening in the future?
0
FirstDirect
Asked:
FirstDirect
  • 5
  • 3
1 Solution
 
GaryCommented:
Is the server time right and it's just the log time that is wrong?
0
 
Ray PaseurCommented:
Please post the PHP code, thanks.
0
 
FirstDirectAuthor Commented:
Server Hardware time is correct. It seems that the System time is what changed. to TWO days behind.

We had a client post a file two days ago (08/05/2014) and then they posted a file this morning (08/07/2014). However the time/date stamp on the file shows 08/05/2014 10:14:38 am.

Logged into webmin to check the server. And sure enough the System time was two days behind.

It was in sync two days ago. But somehow got changed since then.

It is set to synch the time with the firewall as a time server. I checked the firewall and it's date and time are correct.

Is their a log that I can check to see where this date change could have happened?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
GaryCommented:
So it is just from php pages that is reporting the time wrong?
If it was hours it would probably be your timezone but 2 days out is weird

I don't know of any log for date/time changes
0
 
FirstDirectAuthor Commented:
no this is not on PHP pages. This was system time.
0
 
GaryCommented:
Confused - you said the server time was correct
Need to see the cron job code.
0
 
FirstDirectAuthor Commented:
Two times when I go to webmin and look at "System Time"
1. Server Time
2. Hardware Time

Timezone is set correct.

Time server sync is set to go at minute "1" and minute "19" of all days and hours.
0
 
FirstDirectAuthor Commented:
Server time is what was off. So when a client posted a file this morning to the ftp server. Once the file was uploaded it showed an upload time of 08/05/2014 10:14:38 am  versus  08/07/2014 10:14:38 am.

Easy to fix as I went into webmin and told the system to sync and it corrected the time.

I did try to change the timeserver from 192.168.0.1  to north-america.pool.ntp.org which webmin did not like.

After digging I made a change on the outgoing firewall rule for UDP/123. It was originally set to only allow outgoing requests from one subnet. I adjusted it to include the subnet of the server.

Then changed time server to "north-america.pool.ntp.org" and it took it.

This should solve the issue.

It should not be the PHP code as the PHP code makes no time requests. The PHP code is also not being used to serve a web page here. It is running the script we use for some automated processes.

The Cron job executes the PHP and simply runs once a minute.
0
 
FirstDirectAuthor Commented:
Changed Firewall settings, this allowed a change in the timeserver which should resolve future time issues.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now