Monday, February 1, 2016

Correcting the Time Zone and then setting up NTP

Before correcting the time zone we need to know what is the exact timezone we need to set the server to.

Login to the Server as sroot user:

/usr/share/zoneinfo
Here you will find all the zones available to be configured on your Linux server.
If you want to configure the timezone "Europe/London" you will find the file in path.
/usr/share/zoneinfo/Europe/London

Step 1: Configure the /etc/sysconfig/clock
Using the vi editor edit the file and set the ZONE parameter.
ZONE="Europe/London"

Step 2: Configure the /etc/localtime

cd /etc
cp -p local local.old
ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime

Step 3: Reboot the server for the system to be aware of new settings.

We can setup the NTP server also using the following steps.
ntpdate -q ntp_server_address
If no errors are displayed in above command then the NTP server is accessible and will update the time on server too.

You can also configure the ntp server address in the file /etc/ntp.conf
server  ntp_server_address1
server  ntp_server_address2
server  ntp_server_address3

After this you can restart the ntp service
service ntpd restart


No comments:

Post a Comment