編譯安裝Apache須要apr-util,而在編譯安裝apr-util時提示說缺乏expat.h,此時直接安裝expat庫便可(centos):apache
yum install expat-devel
首先安裝libxml2-devel包:centos
yum install libxml2-devel
接着刪除apr-util安裝目錄並從新編譯安裝:bash
sudo rm -rf /usr/local/apr-util cd apr-util make clean ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr make make install
目錄的話根據須要修改,最後從新編譯安裝apache:ide
cd httpd-xxxxx make clean ./configure \ --prefix=/usr/local/apache \ --with-apr=/usr/local/apr \ --with-apr-util=/usr/local/apr-util \ --with-pcre=/usr/local/pcre
一樣目錄按需修改。code