自行編譯 Apache 時,若加上 mod_deflate 模組卻在 configure 階段中斷,看到類似這段訊息:
error: mod_deflate has been requested but can not be built due to prerequisite failures
原因並不複雜:mod_deflate 依賴 zlib 提供的壓縮函式庫,系統上沒有 zlib 的開發標頭檔,configure 自然無法通過檢查。
CentOS 系列安裝 zlib 開發套件:
yum install zlib-devel
Ubuntu/Debian 系列:
apt-get install zlib1g-dev
裝好之後重新執行 configure,並視需要加上 --enable-deflate,即可順利把模組編進 Apache。若先前 configure 失敗留下殘留的 cache,先 make distclean 或乾脆重新解壓原始碼再來一次,可以少踩不少坑。
解決 Ubuntu 編譯核心時 mkimage 找不到的問題
解決 Device eth0 does not seem to be present 報錯
解決「Device eth0 does not seem to be present, delaying initialization」
VM 虛擬機克隆後 eth0 起不來的解法(device eth0 does not seem to be present)
修復 CentOS 克隆後 eth0 消失:Device eth0 does not seem to be present 完整解法