Apache failed to start after upgrading Ubuntu

The problem was that some libraries were not available to Apache.
luser:~# service apache2 start
* Starting web server apache2
apache2: Syntax error on line 166 of /etc/apache2/apache2.conf: Syntax error on line 33 of /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
Action 'start' failed.

Many sites recommended to link libxml file.  Here is what I had to do.
luser:~# ls -l /usr/lib/libxml2.so.2
ls: cannot access /usr/lib/libxml2.so.2: No such file or directory
[email protected]:~# locate libxml2.so
/usr/lib/libxml2.so.2
/usr/lib/libxml2.so.2.9.4

Ubuntu says that file exists.. really?
luser:~# ls -l /usr/lib/libxml2.so.2
ls: cannot access /usr/lib/libxml2.so.2: No such file or directory

Ubuntu and some packages are known to do this when you upgrade.
Solution:
luser:~# cd /usr
luser:/usr# find . -name libxml2.so.2
./lib/powerpc-linux-gnu/libxml2.so.2
luser:/usr# sudo ln -s ./lib/powerpc-linux-gnu/libxml2.so.2 /usr/lib/libxml2.so.2

Start your web server.

Note: the above solution was executed on non-x86 OS.  You can link the file same way in x86/x64 host.

Leave a comment

Your comment