Skip to main content

Installation Perquisite for EFA/Cpanel/CWP7/VestaCP: Part 5 Install Chrony and Configure NTP server

Accurate time keeping is important for a number of reasons in IT. This setup is the best practice that helps with problem diagnosis and informal server monitoring. I am living in Asia that's why i'm using this pool.
Install Chrony and Configure The NTP server .
# yum -y install chrony ( for rpm based )
# apt install chrony ( for debian based )

# vi /etc/chrony.conf ( for rpm based )
# vi /etc/chrony/chrony.conf ( for debian based )

#server 0.centos.pool.ntp.org  iburst
#server 1.centos.pool.ntp.org  iburst
#server 2.centos.pool.ntp.org  iburst
#server 3.centos.pool.ntp.org  iburst

server 0.asia.pool.ntp.org iburst
server 1.asia.pool.ntp.org iburst
server 2.asia.pool.ntp.org iburst
server 3.asia.pool.ntp.org iburst

add the network range you allow to receive requests
allow 127.0.0.1 or allow your network cidr

:x  (save & quit)  
Reminder: We have disabled firewalld, So we will add the port 123/udp after the CWP installation using CSF firewall. Start the services and enable it 
# systemctl start chronyd 
# systemctl enable chronyd 

# chronyc sources
# timedatectl set-ntp yes
# systemctl enable systemd-timedated.service
# systemctl restart systemd-timedated.service

# chronyc tracking
# chronyc sources 
# chronyc sourcestats 

Now this server will work as a NTP server. If you want to use this ntp server in others server, just install the below packages and use your NTP SERVER to your configuration. 
# yum -y install chrony ( for rpm based )
# apt install chrony ( for debian based )

# vi /etc/chrony.conf ( for rpm based )
# vi /etc/chrony/chrony.conf ( for debian based )

#server 0.centos.pool.ntp.org  iburst
#server 1.centos.pool.ntp.org  iburst
#server 2.centos.pool.ntp.org  iburst
#server 3.centos.pool.ntp.org  iburst
server your-ntp-server-fqdn iburst

allow 127.0.0.1

:x  (save & quit)  
Restart the NTP service
For Ubuntu:
# service chrony restart

For RHEL, CentOS, or SUSE:
# systemctl enable chronyd.service
# systemctl start chronyd.service 
Check Status
# chronyc sources
# timedatectl set-ntp yes

# chronyc tracking
# chronyc sourcestats  

Comments