<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[静怡家园]]></title> 
<link>http://www.zhanghaijun.com/index.php</link> 
<description><![CDATA[书山有路勤为径，学海无涯苦作舟！]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[静怡家园]]></copyright>
<item>
<link>http://www.zhanghaijun.com/post//</link>
<title><![CDATA[Linux下快速搭建ntp时间同步服务器]]></title> 
<author>碟舞飞扬 &lt;webmaster@zhanghaijun.com&gt;</author>
<category><![CDATA[Linux技术]]></category>
<pubDate>Fri, 20 May 2011 14:19:18 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//</guid> 
<description>
<![CDATA[ 
	一、搭建时间同步服务器<br/>1、编译安装ntp server<br/><br/>wget http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2.6.tar.gz<br/>tar zxvf ntp-4.2.6.tar.gz<br/>cd ntp-4.2.6<br/>./configure --prefix=/usr/local/ntp --enable-all-clocks --enable-parse-clocks<br/>make &amp;&amp; make install<br/><br/>注：如以上下载地址无法访问，请从ntp官方下载网页（http://www.ntp.org/downloads.html）寻找下载地址。<br/><br/>2、修改ntp.conf配置文件<br/><br/>vi /etc/ntp.conf<br/><br/>①、第一种配置：允许任何IP的客户机都可以进行时间同步<br/>将“restrict default kod nomodify notrap nopeer noquery”这行修改成：<br/><br/>restrict default nomodify<br/><br/>配置文件示例：/etc/ntp.conf<br/><br/>②、第二种配置：只允许192.168.18.***网段的客户机进行时间同步<br/>在restrict default nomodify notrap noquery（表示默认拒绝所有IP的时间同步）之后增加一行：<br/><br/>restrict 192.168.18.0 mask 255.255.255.0 nomodify<br/><br/>配置文件示例：/etc/ntp.conf<br/><br/>3、以守护进程启动ntpd<br/><br/>/usr/local/ntp/bin/ntpd -c /etc/ntp.conf -p /tmp/ntpd.pid<br/><br/>4、ntpd启动后，客户机要等几分钟再与其进行时间同步，否则会提示“no server suitable for synchronization found”错误。<br/><br/>二、配置时间同步客户机<br/><br/>vi /var/spool/cron/root<br/><br/>增加一行，在每天的5点13分、9点13分、14点13分、19点13分与时间同步服务器进行同步<br/><br/>13 5,9,14,19 * * * /usr/sbin/ntpdate 192.168.18.2<br/><br/>备注：如果客户机没有ntpdate，可以下载ntpdate.tar.gz到/usr/sbin/目录，然后解压：<br/><br/>wget http://blog.s135.com/attachment/200708/ntdate.tar.gz<br/>cd /usr/sbin/<br/>tar zxvf ntpdate.tar.gz<br/>文章来源：http://blog.s135.com/post/281/<br/>Tags - <a href="http://www.zhanghaijun.com/tags/ntp/" rel="tag">ntp</a>
]]>
</description>
</item><item>
<link>http://www.zhanghaijun.com/post//#blogcomment</link>
<title><![CDATA[[评论] Linux下快速搭建ntp时间同步服务器]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>