RedHat下编译Apache出现死循环问题的解决
处理完虚拟机下RedHat的网络配置和SSL连接后,试着安装Apache服务器来学习。1、从官网下了一个httpd-2.2.11版本的包,解包都顺利。
2、配置文件,提示错误,需要gcc编译器。应该是安装RedHat的时候选择了最简洁的安装方案,没装上gcc。
3、安装gcc编译器:
进入Linux,挂载Redhat的第一张安装盘,自动运行,查看到没有安装开发工具中的gcc。使用如下说明安装:
方法一:在开发工具中选中有gcc编译器的复选框,一路NEXT过去,提示插入第三张盘,插入后一直提示找不到第三张安装盘。试了几次都这样,没法使用安装盘安装。
方法二:挂载安装盘3,使用命令进入/media/cdrom/.../RPMS/目录:执行以下语句,
rpm -ivh glibc-kernheaders-2.4-9.1.98.EL.i386.rpm
rpm -ivh glibc-headers-2.3.4-2.25.i386.rpm
rpm -ivh glibc-devel-2.3.4-2.25.i386.rpm
rpm -ivh gcc-3.4.6-3.i386.rpm
(注:按如上顺序执行,因为有依赖关系。rpm包名的数字是每个redhat linux版本都不一样的。)
执行成功,再执行一次配置,配置OK。
4、编译
编译没有提示有错误或警告出现,但是编译的时间很长。10分、20分、1小时、2小时还在不停编译中。意味着出现了问题,网上搜了一下,按CTRL+C果然有提示出现一个问题,但是很恼火没有问题的描述。
对编译的信息仔细观察,发现编译一直在重复着一段信息,就像程序进入了死循环。信息摘录如下:
编译中出现的重复信息
1checking build system type i686-pc-linux-gnu
2checking host system type i686-pc-linux-gnu
3checking target system type i686-pc-linux-gnu
4checking for gcc gcc
5checking for C compiler default output file name a.out
6checking whether the C compiler works yes
7checking whether we are cross compiling no
8checking for suffix of executables
9checking for suffix of object files o
10checking whether we are using the GNU C compiler yes
11checking whether gcc accepts -g yes
12checking for gcc option to accept ISO C89 none needed
13checking for a sed that does not truncate output /bin/sed
14checking for grep that handles long lines and -e /bin/grep
15checking for egrep /bin/grep -E
16checking for ld used by gcc /usr/bin/ld
17checking if the linker (/usr/bin/ld) is GNU ld yes
18checking for /usr/bin/ld option to reload object files -r
19checking for BSD-compatible nm /usr/bin/nm -B
20checking whether ln -s works yes
21checking how to recognize dependent libraries pass_all
22checking how to run the C preprocessor gcc -E
23checking for ANSI C header files yes
24checking for sys/types.h yes
25checking for sys/stat.h yes
26checking for stdlib.h yes
27checking for string.h yes
28checking for memory.h yes
29checking for strings.h yes
30checking for inttypes.h yes
31checking for stdint.h yes
32checking for unistd.h yes
33checking dlfcn.h usability yes
34checking dlfcn.h presence yes
35checking for dlfcn.h yes
36checking for g++ no
37checking for c++ no
38checking for gpp no
39checking for aCC no
40checking for CC no
41checking for cxx no
42checking for cc++ no
43checking for cl.exe no
44checking for FCC no
45checking for KCC no
46checking for RCC no
47checking for xlC_r no
48checking for xlC no
49checking whether we are using the GNU C++ compiler no
50checking whether g++ accepts -g no
51checking for g77 no
52checking for xlf no
53checking for f77 no
54checking for frt no
55checking for pgf77 no
56checking for cf77 no
57checking for fort77 no
58checking for fl32 no
59checking for af77 no
60checking for xlf90 no
61checking for f90 no
62checking for pgf90 no
63checking for pghpf no
64checking for epcf90 no
65checking for gfortran no
66checking for g95 no
67checking for xlf95 no
68checking for f95 no
69checking for fort no
70checking for ifort no
71checking for ifc no
72checking for efc no
73checking for pgf95 no
74checking for lf95 no
75checking for ftn no
76checking whether we are using the GNU Fortran 77 compiler no
77checking whetheraccepts -g no
78checking the maximum length of command line arguments 98304
79checking command to parse /usr/bin/nm -B output from gcc object ok
80checking for objdir .libs
81checking for ar ar
82checking for ranlib ranlib
83checking for strip strip
84checking if gcc supports -fno-rtti -fno-exceptions no
85checking for gcc option to produce PIC -fPIC
86checking if gcc PIC flag -fPIC works yes
87checking if gcc static flag -static works yes
88checking if gcc supports -c -o file.o yes
89checking whether the gcc linker (/usr/bin/ld) supports shared libraries yes
90checking whether -lc should be explicitly linked in no
91checking dynamic linker characteristics GNU/Linux ld.so
92checking how to hardcode library paths into programs immediate
93checking whether stripping libraries is possible yes
94checking if libtool supports shared libraries yes
95checking whether to build shared libraries yes
96checking whether to build static libraries yes
97configure: creating libtool
98appending configuration tag "CXX" to libtool
99appending configuration tag "F77" to libtool
100checking for gcc (cached) gcc
101checking whether we are using the GNU C compiler (cached) yes
102checking whether gcc accepts -g (cached) yes
103checking for gcc option to accept ISO C89 (cached) none needed
104checking for a BSD-compatible install /usr/bin/install -c
105checking for ANSI C header files (cached) yes
106checking fcntl.h usability yes
107checking fcntl.h presence yes
108checking for fcntl.h yes
109checking for unistd.h (cached) yes
110checking for string.h (cached) yes
111checking whether byte ordering is bigendian no
112checking for an ANSI C-conforming const yes
113checking for off_t yes
114checking for size_t yes
115checking for working memcmp yes
116checking for stdlib.h (cached) yes
117checking for unistd.h (cached) yes
118checking for getpagesize yes
119checking for working mmap yes
120checking for memmove yes
121checking for bcopy yes
122configure: creating ./config.status
123CONFIG_FILES=Makefile CONFIG_HEADERS= /bin/sh config.status
124config.status: creating Makefile
125config.status: WARNING:'Makefile.in' seems to ignore the --datarootdir setting
126make: Leaving directory `/usr/local/mysoftware/apache/httpd-2.2.11/srclib/apr-util/xml/expat'
127make: Entering directory `/usr/local/mysoftware/apache/httpd-2.2.11/srclib/apr-util/xml/expat'
128make: Warning: File `configure' has modification time 1.5e+07 s in the future
129running CONFIG_SHELL=/bin/sh /bin/sh /usr/local/mysoftware/apache/httpd-2.2.11/srclib/apr-util/xml/expat/configure --disable-option-checking --srcdir=/usr/local/mysoftware/apache/httpd-2.2.11/srclib/apr-util --with-apr=../apr --libdir=${prefix}/lib --bindir=${prefix}/bin --cache-file=/dev/null --srcdir=/usr/local/mysoftware/apache/httpd-2.2.11/srclib/apr-util/xml/expat --prefix=/usr/local/apache2 --exec-prefix=/usr/local/apache2 --libdir=/usr/local/apache2/lib --includedir=/usr/local/apache2/include --bindir=/usr/local/apache2/bin --no-create --no-recursion
130
回到apache的官网安装说明文档去找相关资料,据说可能是apr和apr-util没有安装的原因,于是就开始安装。在编译apr的时候也发现了死循环了,奇怪了。不过这次有提示信息,提示的大意是系统时钟不准确,可能存在安装不完整。
恍然大悟,我的Linxu是使用虚拟机的,而虚拟机过期了,需要将虚拟机所在的Window系统时钟调前才能启Linux。于是在Linux调整日期时间那里使用NTP服务同步到网络时间。问题解决,一路下去,非常顺利。
页:
[1]