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
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop












![Apache: [warn] _default_ VirtualHost overlap on port 80, the first has precedence Error and Solution](http://s13.cyberciti.org/images/shared/rp/3/16.jpg)

{ 3 comments… read them below or add one }
It would be useful if you explained what the problem is, and how you arrived at the solution.
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
Thanks.