问题示例:
make[2]: *** [htpasswd] Error 1
make[2]: Leaving directory `/usr/local/httpd-2.4.33/support'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/httpd-2.4.33/support'
make: *** [all-recursive] Error 1
1.安装依赖包
wget -c http://archive.apache.org/dist/apr/apr-1.6.2.tar.gz
tar -xf apr-1.6.2.tar.gz
cd apr-1.6.2
./configure --prefix=/usr/local/apr
make && make install
wget -c http://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz
tar -xf apr-util-1.6.1.tar.gz
cd apr-util-1.6.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
make && make install
wget -c https://ftp.pcre.org/pub/pcre/pcre-8.41.tar.gz
tar -xf pcre-8.41
cd pcre-8.41
./configure --prefix=/usr/local/pcre
make && make install
2.编译安装apache
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre --enable-mods-shared=most --enable-so --with-included-apr
可能会出现的问题
configure: error: Bundled APR requested but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/.
解决方法:
把解压好的apr和apr-util 复制到 /httpd-2.4.33/srclib/ 中去
cp -r apr-1.6.1 /usr/local/src/httpd-2.4.33/srclib/apr
cp -r apr-util-1.6.2 /usr/local/src/httpd-2.4.33/srclib/apr-util
3.重新编译
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre --enable-mods-shared=most --enable-so --with-included-apr
看看有没有报错,没有的话继续安装
make && make install
完成安装