Properly support Apache 2.2 and 2.4

Can be done by using <IfModule> directive.
Tested on fc20, el7 and Wheezy.

refs #6771