构建和配置apr-util和httpd以在Linux上使用apr-iconv

时间:2011-11-18 19:39:46

标签: linux apache configuration apr

我是一个贪婪的惩罚者,为了证明这一点,我给自己做了一个服务器,并试图自己构建整个LAMP堆栈。然后我遇到了一个问题,在配置/ make / install httpd期间,我发现我编译的apr-util似乎没有正确地获取apr-iconv。顺序是:

  1. configure / make / install apr-1.4.5。
  2. configure / make / install apr-iconv-1.2.1
  3. configure / make / install apr-util-1.3.12
  4. configure / make / install httpd-2.2.21
  5. 所有的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
    

    配置的唯一部分我真的不确定是apr-util配置脚本中的with-apr-iconv设置。引用另一个源目录而不是共享库似乎很奇怪。谁能告诉我我做错了什么?

    服务器信息:

    [root@server ~]# cat /etc/*-release
    CentOS release 5.7 (Final)
    [root@server ~]# uname -m
    i686
    

    配置脚本:

    APR-1.4.5

    ./configure --enable-shared \
                --enable-threads \
                --enable-other-child
    

    APR-的iconv-1.2.1

    ./configure --with-apr=/usr/local/apr
    

    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

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

1 个答案:

答案 0 :(得分:4)

看起来你快到了。

将apr-util源解压缩到新目录中。运行./configure替换--with-apr-iconv = with --with-iconv =将选项值设置为已安装iconv的前缀。例如。的/ usr /本地

您还需要重新配置和编译httpd守护程序。最好从头开始重新开始源代码,从上面的./configure和通常的make,make install magic。