如何搭建ntp时间服务器

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
头像
wwdlyx
帖子: 85
注册时间: 2006-11-20 17:26
来自: 福建厦门
联系:

如何搭建ntp时间服务器

#1

帖子 wwdlyx » 2007-11-09 15:22

我现在使用的是ubuntu6.10,我想安装一个ntp时间服务器,让局域网电脑的时间都跟我这台ubuntu同步。

我利用新立得软件已经把ntp-server安装好了,修改了/etc/ntp.conf(增加restrict 192.168.2.0 mask 255.255.255.0 nomodify notrap),也已经启动了ntp-server服务。但是我用局域网中的一台xp电脑进行时间同步,同步失败。请问是怎么回事?
头像
wwdlyx
帖子: 85
注册时间: 2006-11-20 17:26
来自: 福建厦门
联系:

#2

帖子 wwdlyx » 2007-11-12 10:31

顶上,还望高手能出手相助。
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#3

帖子 eexpress » 2007-11-12 13:09

估计有问题,man或者去irc的英文房间问就是。

自己搭建,是没事作哦。
● 鸣学
头像
wwdlyx
帖子: 85
注册时间: 2006-11-20 17:26
来自: 福建厦门
联系:

#4

帖子 wwdlyx » 2007-11-13 11:16

eexpress 写了:估计有问题,man或者去irc的英文房间问就是。

自己搭建,是没事作哦。
不是没事情做,是有需求。
leo808
帖子: 25
注册时间: 2007-02-25 7:26

#5

帖子 leo808 » 2007-11-19 6:00

楼上的你的服务器好了吗?
头像
wwdlyx
帖子: 85
注册时间: 2006-11-20 17:26
来自: 福建厦门
联系:

#6

帖子 wwdlyx » 2007-11-21 10:30

leo808 写了:楼上的你的服务器好了吗?
还是不行,我用xp获取不到服务器时间
欢迎访问我的qzone
http://21351142.qzone.qq.com
欢迎访问我的blog
http://wuwd.blog.ubuntu.org.cn
marathoner
帖子: 68
注册时间: 2007-12-20 10:37

#7

帖子 marathoner » 2008-03-25 8:29

关注ing

我下载了这个http://ntp.buptnet.edu.cn/ntp_chinese/down/server/ntp-4.2.0.tar.gz

我是7.10 desktop

./configure就出错

checking build system type... i686-pc-linux-gnulibc1
checking host system type... i686-pc-linux-gnulibc1
checking target system type... i686-pc-linux-gnulibc1
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output... configure: error: C compiler cannot create executables
See `config.log' for more details.

xm们是哪个地方出错了?
头像
qiang_liu8183
论坛版主
帖子: 10699
注册时间: 2006-09-10 22:36
系统: Arch Debian
来自: 北京

#8

帖子 qiang_liu8183 » 2008-03-25 8:34

弄它作甚?弄完了你的ntp又从哪里校队时间?
看破、放下、自在、随缘、念佛
真诚、清净、平等、正觉、慈悲
头像
yaoms
帖子: 4952
注册时间: 2007-10-19 14:51
来自: 深圳

#9

帖子 yaoms » 2008-03-25 8:36

就一台XP不行?肯定是它机品问题拉。
Nothing 有事请发邮件到 yms541 AT gmail.com
alias 爱慕颇雷尔='mplayer'
marathoner
帖子: 68
注册时间: 2007-12-20 10:37

#10

帖子 marathoner » 2008-03-25 8:41

楼上的2位xd,还能指点一下?

./configure过程中,哪个地方出错了呢?
头像
yaoms
帖子: 4952
注册时间: 2007-10-19 14:51
来自: 深圳

#11

帖子 yaoms » 2008-03-25 8:46

marathoner 写了:楼上的2位xd,还能指点一下?

./configure过程中,哪个地方出错了呢?
See `config.log' for more details.
Nothing 有事请发邮件到 yms541 AT gmail.com
alias 爱慕颇雷尔='mplayer'
marathoner
帖子: 68
注册时间: 2007-12-20 10:37

#12

帖子 marathoner » 2008-03-25 8:51

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.57. Invocation command line was

$ ./configure

## --------- ##
## Platform. ##
## --------- ##

hostname = ntp-server
uname -m = i686
uname -r = 2.6.22-14-generic
uname -s = Linux
uname -v = #1 SMP Tue Feb 12 07:42:25 UTC 2008

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/X11R6/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1386: checking build system type
configure:1404: result: i686-pc-linux-gnulibc1
configure:1412: checking host system type
configure:1426: result: i686-pc-linux-gnulibc1
configure:1434: checking target system type
configure:1448: result: i686-pc-linux-gnulibc1
configure:1495: checking for a BSD-compatible install
configure:1549: result: /usr/bin/install -c
configure:1560: checking whether build environment is sane
configure:1603: result: yes
configure:1623: checking for gawk
configure:1639: found /usr/bin/gawk
configure:1649: result: gawk
configure:1659: checking whether make sets $(MAKE)
configure:1679: result: yes
configure:1864: checking for style of include used by make
configure:1892: result: GNU
configure:1963: checking for gcc
configure:1979: found /usr/bin/gcc
configure:1989: result: gcc
configure:2233: checking for C compiler version
configure:2236: gcc --version </dev/null >&5
gcc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2239: $? = 0
configure:2241: gcc -v </dev/null >&5
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
configure:2244: $? = 0
configure:2246: gcc -V </dev/null >&5
gcc: '-V' option must have argument
configure:2249: $? = 1
configure:2273: checking for C compiler default output
configure:2276: gcc conftest.c >&5
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure:2279: $? = 1
configure: failed program was:
| #line 2252 "configure"
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define STR_SYSTEM "i686-pc-linux-gnulibc1"
| #define PACKAGE "ntp"
| #define VERSION "4.2.0"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2318: error: C compiler cannot create executables
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=i686-pc-linux-gnulibc1
ac_cv_build_alias=i686-pc-linux-gnulibc1
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=i686-pc-linux-gnulibc1
ac_cv_host_alias=i686-pc-linux-gnulibc1
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=gawk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes
ac_cv_target=i686-pc-linux-gnulibc1
ac_cv_target_alias=i686-pc-linux-gnulibc1
ac_cv_var_atom_ok=no
ac_cv_var_jupiter_ok=no
ac_cv_var_oncore_ok=no
ac_cv_var_ripe_ncc_ok=no

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /usr/local/src/ntp-4.2.0/missing --run aclocal-1.7'
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='${SHELL} /usr/local/src/ntp-4.2.0/missing --run tar'
ANSI2KNR=''
ARLIB_DIR=''
AUTOCONF='${SHELL} /usr/local/src/ntp-4.2.0/missing --run autoconf'
AUTOHEADER='${SHELL} /usr/local/src/ntp-4.2.0/missing --run autoheader'
AUTOMAKE='${SHELL} /usr/local/src/ntp-4.2.0/missing --run automake-1.7'
AWK='gawk'
CC='gcc'
CCDEPMODE=''
CFLAGS=''
CHUTEST=''
CLKTEST=''
CPP=''
CPPFLAGS=''
CYGPATH_W='echo'
DCFD=''
DEFS=''
DEPDIR='.deps'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EF_LIBS=''
EF_PROGS=''
EGREP=''
EXEEXT=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
LCRYPTO=''
LDFLAGS=''
LIBOBJS=''
LIBPARSE=''
LIBS=''
LN_S=''
LTLIBOBJS=''
MAKEINFO='${SHELL} /usr/local/src/ntp-4.2.0/missing --run makeinfo'
MAKE_ADJTIMED=''
MAKE_CHECK_Y2K=''
MAKE_LIBNTPSIM=''
MAKE_LIBPARSE=''
MAKE_LIBPARSE_KERNEL=''
MAKE_NTPDSIM=''
MAKE_NTPTIME=''
MAKE_NTP_KEYGEN=''
MAKE_PARSEKMODULE=''
MAKE_SNTP=''
MAKE_TICKADJ=''
MAKE_TIMETRIM=''
OBJEXT=''
OPENSSL=''
OPENSSL_INC=''
OPENSSL_LIB=''
PACKAGE='ntp'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_VERSION=''
PATH_PERL=''
PATH_SEPARATOR=':'
PATH_SH=''
PROPDELAY=''
RANLIB=''
READLINE_LIBS=''
SET_MAKE=''
SHELL='/bin/bash'
STRIP=''
TESTDCF=''
U=''
VERSION='4.2.0'
ac_ct_CC='gcc'
ac_ct_RANLIB=''
ac_ct_STRIP=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include='include'
am__leading_dot='.'
am__quote=''
bindir='${exec_prefix}/bin'
build='i686-pc-linux-gnulibc1'
build_alias=''
build_cpu='i686'
build_os='linux-gnulibc1'
build_vendor='pc'
datadir='${prefix}/share'
exec_prefix='NONE'
host='i686-pc-linux-gnulibc1'
host_alias=''
host_cpu='i686'
host_os='linux-gnulibc1'
host_vendor='pc'
includedir='${prefix}/include'
infodir='${prefix}/info'
install_sh='/usr/local/src/ntp-4.2.0/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
oldincludedir='/usr/include'
prefix='NONE'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
subdirs=''
sysconfdir='${prefix}/etc'
target='i686-pc-linux-gnulibc1'
target_alias=''
target_cpu='i686'
target_os='linux-gnulibc1'
target_vendor='pc'

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE "ntp"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME ""
#define PACKAGE_STRING ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define STR_SYSTEM "i686-pc-linux-gnulibc1"
#define VERSION "4.2.0"

configure: exit 77
头像
yaoms
帖子: 4952
注册时间: 2007-10-19 14:51
来自: 深圳

#13

帖子 yaoms » 2008-03-25 9:22

ls,试试安装:

sudo apt-get install libc6-dev
Nothing 有事请发邮件到 yms541 AT gmail.com
alias 爱慕颇雷尔='mplayer'
marathoner
帖子: 68
注册时间: 2007-12-20 10:37

#14

帖子 marathoner » 2008-03-25 9:58

yaoms 写了:ls,试试安装:

sudo apt-get install libc6-dev
thx

./configure没有报错了

但是sudo make时,又报错了

(bk version) >/dev/null 2>&1 && \
cd . && \
x=`bk -R prs -hr+ -nd:I: ChangeSet` && \
y=`cat version 2>/dev/null` || true && \
case "$x" in ''|$y) ;; *) echo $x > version ;; esac
make all-recursive
make[1]: Entering directory `/usr/local/src/ntp-4.2.0'
Making all in scripts
make[2]: Entering directory `/usr/local/src/ntp-4.2.0/scripts'
make[2]: 没有什么可以做的为 `all'。
make[2]: Leaving directory `/usr/local/src/ntp-4.2.0/scripts'
Making all in include
make[2]: Entering directory `/usr/local/src/ntp-4.2.0/include'
Making all in isc
make[3]: Entering directory `/usr/local/src/ntp-4.2.0/include/isc'
make[3]: 没有什么可以做的为 `all'。
make[3]: Leaving directory `/usr/local/src/ntp-4.2.0/include/isc'
make[3]: Entering directory `/usr/local/src/ntp-4.2.0/include'
make[3]: 没有什么可以做的为 `all-am'。
make[3]: Leaving directory `/usr/local/src/ntp-4.2.0/include'
make[2]: Leaving directory `/usr/local/src/ntp-4.2.0/include'
Making all in ElectricFence
make[2]: Entering directory `/usr/local/src/ntp-4.2.0/ElectricFence'
make[2]: 没有什么可以做的为 `all'。
make[2]: Leaving directory `/usr/local/src/ntp-4.2.0/ElectricFence'
Making all in libntp
make[2]: Entering directory `/usr/local/src/ntp-4.2.0/libntp'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -g -O2 -Wall -Wcast-qual -Wmissing-prototypes -Wpointer-arith -Wshadow -Wstrict-prototypes -MT systime.o -MD -MP -MF ".deps/systime.Tpo" \
-c -o systime.o `test -f 'systime.c' || echo './'`systime.c; \
then mv -f ".deps/systime.Tpo" ".deps/systime.Po"; \
else rm -f ".deps/systime.Tpo"; exit 1; \
fi
In file included from systime.c:11:
../include/ntp_stdlib.h:138: 错误: 数组元素的类型不完全
make[2]: *** [systime.o] 错误 1
make[2]: Leaving directory `/usr/local/src/ntp-4.2.0/libntp'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/usr/local/src/ntp-4.2.0'
make: *** [all] 错误 2
头像
yaoms
帖子: 4952
注册时间: 2007-10-19 14:51
来自: 深圳

#15

帖子 yaoms » 2008-03-25 9:59

ls 为什么不用源里的,要自己编译?
Nothing 有事请发邮件到 yms541 AT gmail.com
alias 爱慕颇雷尔='mplayer'
回复