• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

ProFTPD showing incorrect time

H

hc_andy

Guest
Hi There...

I can't get ProFTPD to display the local time for the files on our web server. We've had some users advise us that when they FTP into the server, the timestamps of the files are all out of whack. I have also replicated this.

What I see on the web server:
-----------------------------
[root@plesk2 httpdocs]# ls -la
-rw-r--r-- 1 root root 4218629 Aug 28 17:33 pine.tar.gz


What ProFTPD displays to the user via FTP:
------------------------------------------
ftp> ls -la
-rw-r--r-- 1 root root 4218629 Aug 28 02:33 pine.tar.gz

The file was downloaded at 17:33 but it's not showing this via ProFTPD.

I've googled around and added in "TimesGMT off" into my proftpd.conf file and it's still not working.

<Global>
DefaultRoot ~ psacln
AllowOverwrite on
TimesGMT off
</Global>

I have restarted xinetd and this did not work.

I then restarted plesk and this did not work either.

Does anyone have any further ideas why the ProFTPD isn't showing the local time. I've pretty much googled all I can and can't find any other reason why this is happening.

Other information:
------------------

[root@plesk2 httpdocs]# proftpd -v
- ProFTPD Version 1.3.0

Platform psa8.2.0/RedHatel3

psa-proftpd 1.3.0-rhel3.build82070706.15

Thank you in advance.
 
All is working ok now.
Below are the steps taken to resolve the problem.

First make sure the server is set up on the correct time zone.

# ls -la /etc/localtime
lrwxrwxrwx 1 root root 39 May 1 12:25 /etc/localtime -> /usr/share/zoneinfo/Australia/Melbourne

Looks good !!

Next edit /etc/proftpd.conf and add these lines between the <Global> tag.

TimesGMT off
SetEnv TZ :/etc/localtime

Eg:
<Global>
DefaultRoot ~ psacln
AllowOverwrite on
TimesGMT off
SetEnv TZ :/etc/localtime
</Global>

Note: there is no need to restart xinetd (service xinetd restart).

With help from:
http://www.directadmin.com/forum/archive/index.php/t-12105.html
http://www.proftpd.org/docs/howto/Timestamps.html
 
Back
Top