简体   繁体   English

在Centos 6.2(64位)上编译Apache 2.4.3

[英]Compile Apache 2.4.3 on Centos 6.2 (64bit)

I attempt to compile Apache 2.4.3 with apr-1.4.6 and apr-util-1.5.1 on Centos 6.2 (64bit). 我尝试在Centos 6.2(64位)上使用apr-1.4.6和apr-util-1.5.1编译Apache 2.4.3。

./configure --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --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= ./configure --build = x86_64-unknown-linux-gnu --host = x86_64-unknown-linux-gnu --target = x86_64-redhat-linux-gnu --program-prefix = --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 / 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

and when I issue make this happen: 当我发出让这件事发生时:

/root/httpd-2.4.3/srclib/apr/libtool: line 5989: cd: yes/lib: No such file or directory libtool: link: cannot determine absolute directory name of 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] Error 1 make[2]: Leaving directory /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 /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绝对目录名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]错误1

anything I missed? 我错过了什么?

Please do as following: 请执行以下操作:

# 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/ 

The above got me to the point where I was able to install apache 2.4.3. 以上让我能够安装apache 2.4.3。 Unfortunately for me, and maybe you too, I saw this when doing apachectl -k start: 不幸的是,对我来说,也许你也是,我在做apachectl -k启动时看到了这个:

httpd: Syntax error on line 141 of /home/netman1/sp/usr/local/apache/conf/httpd.conf: Cannot load modules/mod_dir.so into server: home/netman1/sp/usr/local/apache/modules/mod_dir.so: undefined symbol: apr_array_clear httpd:/home/netman1/sp/usr/local/apache/conf/httpd.conf第141行的语法错误:无法将modules / mod_dir.so加载到服务器:home / netman1 / sp / usr / local / apache / modules /mod_dir.so:未定义的符号:apr_array_clear

I did this, and found a stale links pointing to an older version of libapr-1.so. 我做到了这一点,发现一个陈旧的链接指向旧版本的libapr-1.so。

ldd httpd | 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) 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)

To fix this mess, I saved off the old link, and then created a new link pointing to the correct version: 为了解决这个问题,我保存了旧的链接,然后创建了一个指向正确版本的新链接:

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

Now, I can start apache, and at least it does not complain about an 'undefined symbol: apr_array_clear'... Hope this helps you. 现在,我可以启动apache,至少它不会抱怨'未定义的符号:apr_array_clear'...希望这会对你有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM