So you want to add mod_deflate to Apache but without recompiling it. You can compile just that module and add it dynamically.
What we need to do is create mod_deflate.so where the .so stands for shared object.
First find where apxs and apr-config are located. For me it was in /usr/local/apache/bin
Edit the apr-config file and change this line:
to this one:
Then go to your Apache source files (or download them off of apache.org). Go to modules/filters and find the mod_deflate.c file.
apxs -c mod_deflate.c
You should now have these files:
Notice there is no mod_deflate.so file there. This is where I got stuck. Fortunately on Apache’s site they indicate to do this:
apxs -i -a -n deflate mod_deflate.la
That creates the mod_deflate.so file, puts it in the modules folder, and adds this to your httpd.conf:
LoadModule deflate_module modules/mod_deflate.so
There you go.