CentOS 6.5 64-bit installation of ntp 4.2.7p425 tutorial
Obviously, if you want to upgrade the NTP server to 4.2.7p26, you can only compile and install the ntp 4.2.7p425 for the development version.
To verify this solution, I compiled and installed the development version ntp in CentOS, But I encountered many problems when referring to the online tutorials.
I. conditions and environment:
1. CentOS: I use the latest CentOS 6.5 64-bit version. This tutorial should also be applicable to all systems of RedHat 6 and CentOS 6;
2. environment required for compilation:
# Yum-y install vim ntp * wget gcc-c ++ ncurses-devel cmake make
# Cp/etc/ntp. conf/usr/local/src/ntp. conf
# Yum remove ntp *
Note: The configuration file is not automatically generated under/etc during compilation and installation. Therefore, I first install ntp 4.2.6p5 in yum to generate/etc/ntp. conf, copy the configuration file, and then uninstall ntp.
3. Disable the firewall and SELINUX!
# Chkconfig iptables off
# Vim/etc/sysconfig/selinux
Modify SELINUX = enforcing:
SELINUX = disabled
2. Download and install ntp 4.2.7p425:
1. Download ntp 4.2.7p425:
If the server can access the Internet, you can directly use the wget command to download:
# Cd/usr/local/src
# Wget http://www.eecis.udel.edu /~ Ntp/ntp_spool/ntp4/ntp-dev/ntp-dev-4.2.7p425.tar.gz
If the server cannot access the Internet, go to http://www.ntp.org/downloads.htmlto download to the server. Then, transfer sftpor ftpto the server!
2. Unpack and install ntp-dev-4.2.7p0000.tar.gz:
# Tar zxvf ntp-dev-4.2.7p425.tar.gz
# Cd ntp-dev-4.2.7p425
#./Configure -- prefix =/usr/local/ntp -- enable-all-clocks -- enable-parse-clocks
# Make & make install
3. modify the configuration file ntp. conf:
# Cp/usr/local/src/ntp. conf/etc/ntp. conf
# Vim/etc/ntp. conf
(1) configuration: allow any IP Client to synchronize time
Modify the line "restrict default kod nomodify notrap nopeer noquery":
Restrict default nomodify
(2) configuration: only allow clients in the 192.168.200. * network segment to synchronize time
Add a line after "restrict default kod nomodify notrap nopeer noquery" (indicating that all IP addresses are denied time synchronization by default:
Restrict 192.168.200.0 mask 255.255.255.0 nomodify
In addition, the default network synchronization time of the configuration file is as follows:
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
(RedHat has four lines of content by default, and the domain name is different)
If you need to use the local time, delete the above four lines or comment out them with the "#" number, and then add the following two lines:
Server 127.127.1.0
Fudge 127.127.1.0 stratum 10
(RedHat has the above two rows by default, but is commented out)
4. Start the ntp service:
#/Usr/local/ntp/bin/ntpd-c/etc/ntp. conf-p/tmp/ntpd. pid
# Run the following command to check whether the ntp server is running in the background:
# Ps-ef | grep ntp
# Run the following command to check whether the UDP 123 port listened by ntpd is normal:
# Netstat-unl | grep 123
5. Use a client to check whether the clock synchronization server is available.
6. To Enable Automatic startup of the ntpd service, you only need to put the preceding startup command in the/etc/rc. local file.