分类: LINUX
2013-05-04 23:18:53
官方:
wget ""
apache安装依赖APR and APR-Util,可能因找不到apr而出错。
tar -zxvf apr-1.4.6.tar.gz
cd apr-1.4.6
./configure --prefix=/usr/local
make & make install
tar -zxvf apr-util-1.5.2.tar.gz
cd apr-util-1.5.2
./configure --with-apr=/usr/local/bin
make & make install
tar -zxvf pcre-8.21.tar.gz
cd pcre-8.21
./configure --prefix=/usr/local
make & make install
tar -zxvf httpd-2.4.4.tar.gz
cd httpd-2.4.4
mv ../apr-1.4.6 srclib/apr -R
mv ../apr-util-1.5.2 srclib/apr-util -R
./configure --with-included-apr --with-pcre=/usr/local/bin/pcre-config --with-layout=Apache --enable-modules=most --enable-mods-shared=list --with-mpm=prefork
make & make install
说明:
1.如下安装httpd-2.x时可能出错
exports.c:1582: error: previous definition of 'ap_hack_apr_proc_mutex_lockfile' was here
原因是未找到正确的apr,apu路径,要重新安装apr,apr-util,并且写出正确文件路径。
--with-apr=/usr/local/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config
2. 发现启动时会出错/mod_dir.so: undefined symbol: apr_array_clear
改为使用--with-included-apr 及指定pcre-config ,可以正常启动:
tar -zxvf apr-1.4.6.tar.gz
tar -zxvf apr-util-1.5.2.tar.gz
cd httpd-2.4.4
mv ../apr-1.4.6 srclib/apr -R
mv ../apr-util-1.5.2 srclib/apr-util -R
./configure --with-included-apr --with-pcre=/usr/local/bin/pcre-config --with-layout=Apache --enable-modules=most --enable-mods-shared=list --with-mpm=prefork
看来还是--with-included-apr 最可靠!