重複編譯安裝 Apache 至相同前綴目錄(/usr/local/apache2)時,make install 因殘留 libtool 檔案失敗。本文提供兩種乾淨重建方法。
libtool: install: error: cannot install `libaprutil-1.la' to a directory not ending in /usr/local/apache2/lib
./configure --prefix=/usr/local/apache2 安裝留下 .la、.lo、Makefile 等檔案。make clean
./configure --prefix=/usr/local/apache2 --with-apr=/path/to/apr --with-apr-util=/path/to/apr-util
make
make install
cd /usr/src
rm -rf httpd-2.2.3
tar xzf httpd-2.2.3.tar.gz
cd httpd-2.2.3
./configure --prefix=/usr/local/apache2 ...
make && make install
編譯 mod_fcgid 等模組時,若 Makefile 寫死 apache2 目錄,需手動修改 Makefile 中的 top_builddir、install_dir 等變數指向正確路徑。
make distclean 或重新解壓原始碼。/usr/local/apache-2.4.58)並建立符號連結 /usr/local/apache2 -> apache-2.4.58,方便版本切換。yum install httpd/apt install apache2),僅在需要特定模組/版本時自行編譯。