我正在尝试编译 apache 2.4.6。我已经成功编译并安装了最新的 apr (1.4.x) 和 apr-util (1.5.x)。
下面是我的环境设置、编译设置,以及每次打包后对 LD_LIBRARY_PATH 的修改:
ENVPREFIX=/auto/custom-libs/linux/centos/6.x/x86_64/pkgs/httpd-2.4.6/
INSTALLPREFIX=${ENVPREFIX}
export PATH=${INSTALLPREFIX}/bin:$PATH
# APR compilation settings
./configure --prefix=${INSTALLPREFIX} --enable-other-child --enable-allocator-uses-mmap --enable-threads
make -j16
make install
export LD_LIBRARY_PATH=${INSTALLPREFIX}/lib:$LD_LIBRARY_PATH
# APR-util compilation settings
./configure --prefix=${INSTALLPREFIX} --with-apr=${ENVPREFIX}/bin/apr-1-config --with-mysql=/usr/bin/mysql --with-crypto --with-ldap-lib=${ENVPREFIX}/lib --with-ldap-include=${ENVPREFIX}/include --with-openssl=/usr/lib64/openssl
make -j16
make install
export LD_LIBRARY_PATH=${INSTALLPREFIX}/lib/apr-util-1/:$LD_LIBRARY_PATH
# Apache httpd compilation parameters
./configure --prefix=${INSTALLPREFIX} --enable-mpms-shared='all' --enable-rewrite --enable-ssl --enable-proxy --enable-cache --enable-pie --enable-mods-shared='all' --enable-ssl-staticlib-deps --enable-session --enable-proxy-balancer --enable-usertrack --with-apr=${ENVPREFIX}/bin --with-apr-util=${ENVPREFIX}/bin
make -j16
make install
export LD_LIBRARY_PATH=${INSTALLPREFIX}/lib/modules/:$LD_LIBRARY_PATH
一切都很好,直到我开始一个香草网站。我改变的只是非标准 8000 的端口和用户名。不幸的是,我遇到以下错误,提示某些版本与最新的 apache 2.4.6 代码附带的模块不兼容。
命令:
httpd -f `pwd`/httpd.conf
错误输出:
httpd: Syntax error on line 137 of /home/prigor/codebase/pediatrics/webservices/pedws/pedws/apache/httpd.conf: Cannot load modules/mod_session_cookie.so into server: /auto/igb-libs/linux/centos/6.x/x86_64/pkgs/httpd-2.4.6/modules/mod_session_cookie.so: undefined symbol: ap_hook_session_save
即使禁用此模块后,其余模块仍然存在相同的错误。也许我为 apr 和 apr-util 使用了不正确的版本?也许我在某处设置了不正确的配置开关?
在此先感谢您的帮助!