2012-12-11 70 views
0

我尝试在Centos 6.2(64位)上使用apr-1.4.6和apr-util-1.5.1编译Apache 2.4.3。在Centos 6.2(64bit)上编译Apache 2.4.3

的./configure --build = x86_64的未知-Linux的GNU 主机= x86_64的未知-Linux的GNU --target = x86_64的-红帽-Linux的GNU --program前缀= - -prefix =/usr --exec-prefix =/usr --bindir =/usr/bin --sbindir =/usr/sbin --sysconfdir =/etc --datadir =/usr/share --includedir =/usr/include --libdir =/usr/lib64 --libexecdir =/usr/libexec --localstatedir =/var --sharedstatedir =/var/lib --mandir =/usr/share/man --infodir =/usr/share/info --cache-file = ../config.cache --with-libdir = lib64 --with-config-file-path =/etc --with-config-file-scan-dir =/etc/php.d --disable-debug --with-pic --disable -rpath --without-pear --with-bz2 --with-exec-dir =/usr/bin --with-freetype-dir =/usr --with -png-dir =/usr --with-xpm-dir =/usr --enable -gd-native -ttf --with-t1lib =/usr --without-gdbm --with-gettext --with-gmp - -with-iconv --with-jpeg -dir =/usr --with-openssl --with-zlib --with-layout = GNU --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --with-kerberos - -enable-ucd-snmp-hack --enable-shmop --enable-calendar --with-libxml-dir =/usr --enable-xml --with-system-tzdata --with-mhash --with-apxs2 =/usr/sbin/apxs --libdir =/usr/lib64/php --enable-pdo = shared --with-mysql = shared,/ usr --with-mysqli = shared,/ usr/lib64/mysql/mysql_config --with-pdo-mysql = shared,/ usr/lib64/mysql/mysql_config --without-pdo-sqlite --without-gd --disable-dom --disable-dba --without-unixODBC --disable-xmlreader --disable-xmlwriter --without-sqlite3 --disable-phar --disable-fileinfo --disable -json --without-pspell --disable-wddx --without-curl --disable-posix --disable-sysvmsg --disable-sysvshm --disable-sysvsem ./configure --with-included-apr --with-included-apr-util

当我发出这样的事情时:

/root/httpd-2.4.3/srclib/apr/libtool:line 5989:cd:yes/lib:没有这样的文件或目录 libtool:link:无法确定绝对目录名yes/lib' make[3]: *** [libaprutil-1.la] Error 1 make[3]: Leaving directory /root/httpd-2.4.3/srclib/apr-util' make [2]:* [all-recursive]错误1 make [2]:离开目录/root/httpd-2.4.3/srclib/apr-util' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory /root/httpd-2.4。 3/srclib' make:* [all-recursive] Error 1

我错过了什么?

+1

为什么在同一个命令行中输入两个./configure? –

+0

啊。我的错。但问题仍然存在。 – RiseCakoPlusplus

回答

0

请做如下:

# Build and install apr 1.2 
cd srclib/apr 
./configure --prefix=/usr/local/apr-httpd/ 
make 
make install 

# Build and install apr-util 1.2 
cd ../apr-util 
./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/ 
make 
make install 

# Configure httpd 
cd ../../ 
./configure --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/ 
+0

libtool:链接:无法找到库'/usr/lib64/php/libapr-1.la'或未处理的参数'/usr/lib64/php/libapr-1.la' make [2]:*** [ htpasswd]错误1 make [2]:离开目录'/root/httpd-2.4.3/support' make [1]:*** [all-recursive]错误1 make [1]:离开目录'//root/httpd-2.4.3/support' make:*** [all-recursive]错误1 – RiseCakoPlusplus

+0

在此之前,apache 2.4.3需要至少apr 1.4 – RiseCakoPlusplus

+0

--libdir =/usr/lib64/php为什么分配在这里搜索?请添加更多路径。 –

0

上面有我的地方,我能够安装Apache 2.4.3点。对我来说不幸的是,也许你也是这样,我在做apachectl -k start时看到了这个:

httpd:/home/netman1/sp/usr/local/apache/conf/httpd.conf的第141行的语法错误: 无法加载模块/ mod_dir.so到服务器: 家/ netman1/SP在/ usr /本地/ Apache /模块/ mod_dir.so: 未定义的符号:apr_array_clear

我照做了,发现过期的链接指向旧版本的libapr-1.so。

ldd httpd | grep apr libaprutil-1.so.0 => /home/netman1/usr/local/apache/apr/lib/libaprutil-1.so.0(0x00002aba9dccb000) libapr-1.so.0 =>/usr/lib64下/ libapr-1.so。0(0x00002aba9defd000)

要解决这个烂摊子,我救脱去旧链接,然后创建指向正确的版本,新的链接:

fixed: libapr-1.so.0 -> /opt/app/p3smk1c1/usr/local/apache/apr/lib/libapr-1.so.0.4.6 
broken: libapr-1.so.0 -> libapr-1.so.0.2.7 

现在,我可以启动apache,并至少它不抱怨'未定义的符号:apr_array_clear'...希望这可以帮助你。