Monday, July 26, 2010

Install and configure NTP on CentOS 5.3

  1. Install NTP (Network Time Protocol):
    yum -y install ntp

  2. Edit the NTP config file:
    vi /etc/ntp.conf

  3. At line 18, find "server 2.centos.pool.ntp.org" and under, add:
    server time.nrc.ca
    server time.chu.nrc.ca
    server tock.utoronto.ca
    server tick.utoronto.ca

  4. Ajust the other NTP config file by editing:
    vi /etc/sysconfig/ntpd

  5. At that file's second line:
    OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid"

  6. Modify this line to add the option -x that will force a NTP synch at boot time:
    OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"

  7. Restart NTPD service:
    service ntpd start

  8. Ajust system to automaticaly start the service at boot:
    chkconfig ntpd on

    Reference link