apache 2.4已经不自带apr库,需要独立安装才行:
注意:
不要指定--prefix=/app/apache,否则出现error: cannot install `libaprutil-1.la' to a directory not ending in /usr/local/apache2/lib。
因为编译使用了shared modules,必须添加LoadModule authz_host_module modules/mod_authz_host.so,否则出现 Invalid command 'Order', perhaps misspelled or defined by a module not included in the server config 。
验证apxs安装:
/usr/local/apache2/bin/apxs -c -i
cp -f build/rpm/httpd.init /etc/init.d/httpd
chmod +x /etc/init.d/httpd
chkconfig --add httpd chkconfig httpd on
cd /etc
mv httpd httpd_old
mkdir -p httpd/conf.d
ln -s /usr/local/apache/conf httpd/conf
cd /usr/sbin/
ln -fs /usr/local/apache/bin/httpd
ln -fs /usr/local/apache/bin/apachectl
cd /var/log
rm -rf httpd/
ln -s /usr/local/apache/logs httpd