Debian / Ubuntu Linux 升級, 遇到下述錯誤訊息(下述把錯誤訊息都統整在一起), 而造成 Apache 無法啟動.
The apache2 configtest failed, so we are trying to kill it manually. This is almost certainly suboptimal, so please make sure your system[warnorking as you'd expect now! ... (warning).
/usr/lib/libxml2.so.2: cannot open shared object file: No such file or directory
/etc/apache2/mods-enabled/mod-security.load: Cannot load /usr/lib/libxml2.so.2 into server: /usr/lib/libxml2.so.2: cannot open shared object file: No such file or directory
解法
遇到問題當下的解法, 先註解掉.
- vim /etc/apache2/mods-enabled/mod-security.load
#LoadFile /usr/lib/libxml2.so.2
LoadModule security2_module /usr/lib/apache2/modules/mod_security2.so
於此篇有找到正確解法: #670247 - libapache2-modsecurity: Cannot load /usr/lib/libxml2.so.2 into server - Broken library path,下述為此篇的重點摘錄:
- This bug is only for 64 bit architecture.
- 原本 LoadFile /usr/lib/libxml2.so.2 的路徑有錯誤
- 正確路徑: /usr/lib/x86_64-linux-gnu/libxml2.so.2, 所以有下述兩種解法. (挑其一即可)
- 一: ln -s /usr/lib/x86_64-linux-gnu/libxml2.so.2 /usr/lib/libxml2.so.2
- 二: vim /etc/apache2/mods-enabled/mod-security.load
#LoadFile /usr/lib/libxml2.so.2
LoadFile /usr/lib/x86_64-linux-gnu/libxml2.so.2
LoadModule security2_module /usr/lib/apache2/modules/mod_security2.so