За да работи правилно един NTP сървър трябва да се пренасочи порт 123 от рутера към хоста(сървъра), като протокола да е UDP. Следващото нещо е да се инсталира и самата услуга.
# apt-get install ntp
И малко да го конфигурираме този сървис
# vi /etc/ntp.conf # pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will # pick a different set every time it starts up. Please consider joining the # pool: <http://www.pool.ntp.org/join.html>/> # pool 0.debian.pool.ntp.org iburst # pool 1.debian.pool.ntp.org iburst # pool 2.debian.pool.ntp.org iburst # pool 3.debian.pool.ntp.org iburst server 0.bg.pool.ntp.org server 1.bg.pool.ntp.org server 2.bg.pool.ntp.org server 3.bg.pool.ntp.org
И да рестартираме сървиса
# systemctl restart ntp # systemctl enable ntp Synchronizing state for ntp.service with sysvinit using update-rc.d... Executing /usr/sbin/update-rc.d ntp defaults Executing /usr/sbin/update-rc.d ntp enable
Да проверим и работоспособността на сървиса
# systemctl status ntp ● ntp.service - LSB: Start NTP daemon Loaded: loaded (/etc/init.d/ntp) Active: active (running) since Tue 2016-04-05 15:19:52 EEST; 15s ago CGroup: /system.slice/ntp.service └─5335 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 106:111 Apr 05 15:19:52 home ntp[5328]: Starting NTP server: ntpd. Apr 05 15:19:52 home ntpd[5335]: proto: precision = 0.102 usec Apr 05 15:19:52 home ntpd[5335]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123 Apr 05 15:19:52 home ntpd[5335]: Listen and drop on 1 v6wildcard :: UDP 123 Apr 05 15:19:52 home ntpd[5335]: Listen normally on 2 lo 127.0.0.1 UDP 123 Apr 05 15:19:52 home ntpd[5335]: Listen normally on 3 eth0 10.25.0.5 UDP 123 Apr 05 15:19:52 home ntpd[5335]: Listen normally on 4 lo ::1 UDP 123 Apr 05 15:19:52 home ntpd[5335]: Listen normally on 5 eth0 fe80::20c:29ff:f...23 Apr 05 15:19:52 home ntpd[5335]: peers refreshed Apr 05 15:19:52 home ntpd[5335]: Listening on routing socket on fd #22 for ...es Hint: Some lines were ellipsized, use -l to show in full.
Всичко е наред
# ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== ns.bsdbg.net .GPS. 1 u 11 64 7 14.585 1384.53 356.531 212.70.148.11 80.96.120.252 2 u 8 64 7 13.734 1391.53 359.173 212.70.148.13 131.107.13.100 2 u 10 64 7 15.545 1390.58 353.769 anycast-ntp.com 204.152.184.72 2 u 7 64 7 20.559 1396.57 359.683
Ами това е, идва Apache, но в следващата статия