构建和配置 apr-util 和 httpd 以在 Linux 上使用 apr-iconv
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8188158/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Building and configuring apr-util and httpd to use apr-iconv on Linux
提问by ogradyjd
I'm a glutton for punishment, and to prove it, I got myself a server and tried to build the entire LAMP stack myself. Then I ran into a problem where during a configure/make/install of httpd, I found that my compiled apr-util seemed to be not picking up apr-iconv properly. The sequence is:
我是一个喜欢惩罚的人,为了证明这一点,我给自己买了一台服务器,并试图自己构建整个 LAMP 堆栈。然后我遇到了一个问题,在 httpd 的配置/制作/安装过程中,我发现我编译的 apr-util 似乎没有正确拾取 apr-iconv。顺序是:
- configure/make/install apr-1.4.5.
- configure/make/install apr-iconv-1.2.1
- configure/make/install apr-util-1.3.12
- configure/make/install httpd-2.2.21
- 配置/制作/安装 apr-1.4.5。
- 配置/制作/安装 apr-iconv-1.2.1
- 配置/制作/安装 apr-util-1.3.12
- 配置/制作/安装 httpd-2.2.21
All the apr's built fine, but when I tried to "make" httpd, I got this message:
所有 apr 都构建得很好,但是当我尝试“制作”httpd 时,我收到了以下消息:
make[3]: Leaving directory `/root/software/httpd-2.2.21/modules/mappers'
make[2]: Leaving directory `/root/software/httpd-2.2.21/modules/mappers'
make[1]: Leaving directory `/root/software/httpd-2.2.21/modules'
Making all in support
make[1]: Entering directory `/root/software/httpd-2.2.21/support'
make[2]: Entering directory `/root/software/httpd-2.2.21/support'
/usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/root/software/httpd-2.2.21/srclib/pcre -I. -I/root/software/httpd-2.2.21/os/unix -I/root/software/httpd-2.2.21/server/mpm/prefork -I/root/software/httpd-2.2.21/modules/http -I/root/software/httpd-2.2.21/modules/filters -I/root/software/httpd-2.2.21/modules/proxy -I/root/software/httpd-2.2.21/include -I/root/software/httpd-2.2.21/modules/generators -I/root/software/httpd-2.2.21/modules/mappers -I/root/software/httpd-2.2.21/modules/database -I/usr/local/apr/include/apr-1 -I/root/software/apr-util-1.3.12/../apr-iconv-1.2.1/include -I/usr/include -I/root/software/httpd-2.2.21/server -I/root/software/httpd-2.2.21/modules/proxy/../generators -I/usr/local/ssl/include -I/root/software/httpd-2.2.21/modules/ssl -I/root/software/httpd-2.2.21/modules/dav/main -prefer-non-pic -static -c htpasswd.c && touch htpasswd.lo
/usr/local/apr/build-1/libtool --silent --mode=link gcc -g -O2 -pthread -L/usr/lib -L/usr/local/ssl/lib -o htpasswd htpasswd.lo -lm /root/software/httpd-2.2.21/srclib/pcre/libpcre.la /usr/local/apr/lib/libaprutil-1.la -lgdbm /root/software/apr-util-1.3.12/../apr-iconv-1.2.1/lib/libapriconv.la -lexpat /usr/local/apr/lib/libapr-1.la -lrt -lcrypt -lpthread -ldl -lcrypt
libtool: link: cannot find the library `/root/software/apr-util-1.3.12/../apr-iconv-1.2.1/lib/libapriconv.la' or unhandled argument `/root/software/apr-util-1.3.12/../apr-iconv-1.2.1/lib/libapriconv.la'
make[2]: *** [htpasswd] Error 1
make[2]: Leaving directory `/root/software/httpd-2.2.21/support'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/software/httpd-2.2.21/support'
make: *** [all-recursive] Error 1
The only part of the configuration I'm really not sure about is the with-apr-iconv setting in the apr-util configure script. It seems weird to reference another source directory instead of the shared libraries. Can anyone tell me what I'm doing wrong?
我唯一不确定的配置部分是 apr-util 配置脚本中的 with-apr-iconv 设置。引用另一个源目录而不是共享库似乎很奇怪。谁能告诉我我做错了什么?
Server Info:
服务器信息:
[root@server ~]# cat /etc/*-release
CentOS release 5.7 (Final)
[root@server ~]# uname -m
i686
Configure scripts:
配置脚本:
apr-1.4.5
4月-1.4.5
./configure --enable-shared \
--enable-threads \
--enable-other-child
apr-iconv-1.2.1
apr-iconv-1.2.1
./configure --with-apr=/usr/local/apr
apr-util-1.3.12
apr-util-1.3.12
./configure --with-apr=/usr/local/apr/bin/apr-1-config \
--with-apr-iconv=../apr-iconv-1.2.1 \
--with-mysql=/usr \
--with-sqlite3=/usr \
--with-expat=/usr \
--with-gdbm=/usr
httpd-2.2.21
httpd-2.2.21
./configure --enable-authn-anon \
--enable-v4-mapped \
--enable-authz-owner \
--enable-auth-digest \
--disable-imagemap \
--enable-dav \
--enable-dav-fs \
--enable-dav-lock \
--enable-deflate \
--enable-expires \
--enable-headers \
--enable-info \
--enable-mime-magic \
--enable-proxy \
--enable-proxy-ajp \
--enable-proxy-http \
--enable-proxy-ftp \
--enable-proxy-balancer \
--enable-proxy-connect \
--enable-suexec \
--enable-rewrite \
--enable-so \
--enable-ssl \
--with-ssl=/usr/local/ssl \
--disable-userdir \
--enable-vhost-alias \
--with-mpm=prefork \
--enable-mods-shared=all \
--with-apr=/usr/local/apr/bin/apr-1-config \
--with-apr-util=/usr/local/apr/bin/apu-1-config
采纳答案by SlowTurtle
Looks like you are almost there.
看起来你快到了。
Extract the apr-util sources into a new directory. Run your ./configure replacing --with-apr-iconv= with --with-iconv= setting the option value to the prefix of where you have installed iconv. E.g. /usr/local
将 apr-util 源提取到一个新目录中。运行您的 ./configure 用 --with-iconv= 替换 --with-apr-iconv= 将选项值设置为您安装 iconv 的位置的前缀。例如 /usr/local
You will need to reconfigure and compile your httpd daemon as well. Best to start again from scratch with a clean extraction of source, your ./configure from above and the usual make, make install magic.
您还需要重新配置和编译 httpd 守护程序。最好从头开始重新开始,干净地提取源代码、上面的 ./configure 以及通常的 make、make install magic。