≡ Menu

FreeBSD: Cannot load /usr/local/libexec/apache22/mod_security2.so into server: /usr/local/libexec/apache22/mod_security2.so

Q. I’ve installed Apache2 and mod_security21 under FreeBSD. Whenever I try to restart apach22 process I get following error:

Performing sanity check on apache22 configuration:
httpd: Syntax error on line 106 of /usr/local/etc/apache22/httpd.conf: Cannot load /usr/local/libexec/apache22/mod_security2.so into server: /usr/local/libexec/apache22/mod_security2.so: Undefined symbol “xmlFree”

How do I fix this problem?

A. First make sure you are running updated version for both Apache and mod_security. Next open your httpd.conf file:
vi /usr/local/etc/apache22/httpd.conf
Find line that read as follows:

LoadModule security2_module   libexec/apache22/mod_security2.so

Add line before above directive, so that it should look like as follows:

LoadFile /usr/local/lib/libxml2.so
LoadModule security2_module   libexec/apache22/mod_security2.so

Save and close the file. Restart apache:
# /usr/local/etc/rc.d/apache22 restart

Share this tutorial on:

Your support makes a big difference:
I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft, takes a lot of my time and hard work to produce. If you use nixCraft, who likes it, helps me with donations:
Become a Supporter →    Make a contribution via Paypal/Bitcoin →   

Don't Miss Any Linux and Unix Tips

Get nixCraft in your inbox. It's free:



{ 3 comments… add one }
  • z September 18, 2008, 3:45 pm

    It would be useful if you explained what the problem is, and how you arrived at the solution.

  • nixCraft September 18, 2008, 8:26 pm

    a) Error itself indicated that it can not load xmlFree, which is part of libxml (used by many open source apps). So I needed to load libxml before mod_security. This is well known problem with apache.

    b) Run strings command on mod_security2.so to get idea about functions and other sutff

    c) Track syscall by running ktrace

    d) Experience

    HTH

  • z September 19, 2008, 10:40 pm

    Thanks.

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">


   Tagged with: , , , , , ,