自宅サーバ構築MY HOME SERVER
サーバ時刻設定(NTP) |
- サーバ時刻設定(NTP) -
サーバーにntpクライアントをインストールしておけば、ntpサーバーに接続して正確な時間を取得することができます。 自動で正確な時刻を取得するように設定・保存します。
root@hoge123:~# aptitude -y install ntp root@hoge123:~# vi /etc/ntp.conf 21行目付近、先頭に#を付けて、コメントアウトします。 #server 0.debian.pool.ntp.org iburst #server 1.debian.pool.ntp.org iburst #server 2.debian.pool.ntp.org iburst #server 3.debian.pool.ntp.org iburst 下記内容を追記します。 server ntp1.jst.mfeed.ad.jp server ntp2.jst.mfeed.ad.jp server ntp3.jst.mfeed.ad.jp 48行目付近に追記します。 restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap root@hoge123:~# /etc/init.d/ntp restart ← ntpサービスを起動します。 Stopping NTP server: ntpd. Starting NTP server: ntpd. root@hoge123:~# ntpq -p ← ntpが動作して、同期しているか確認します。 下図のように表示されれば、同期しています。5〜10分位待ってから試してください remote refid st t when poll reach delay offset jitter ==================================================================== +ntp1.jst.mfeed. 210.173.160.56 2 u 36 128 377 26.210 -16.264 5.985 +ntp2.jst.mfeed. 210.173.160.86 2 u 68 128 377 26.182 -4.555 12.769 *ntp3.jst.mfeed. 210.173.160.86 2 u 36 128 377 26.152 -13.165 6.577 |