Apache - how do I build individual and/or all modules as shared modules

22,564

Solution 1

Try the ./configure option --enable-mods-shared="all", or --enable-mods-shared="<list of modules>" to compile modules as shared objects. See further details in Apache 2.2 docs

To just compile Apache with the ability to load shared objects (and add modules later), use --enable-so, then consult the documentation on compiling modules seperately in the Apache 2.2. DSO docs.

Solution 2

./configure --prefix=/usr/local/apache2 --enable-mods-shared="all" --enable-proxy=shared

To get rewrite, proxy and bunch of other modules, I used the above command. In my previous installation, using --enable-mods-shared="all" compiled/installed the proxy module as well. But in v2.2.22 "all" did not include the proxy module.

Share:
22,564
Brian Lyttle
Author by

Brian Lyttle

Northern Irish expatriate living and working near Philadelphia. I'm an Escalation Engineer at Yammer which is part of the Microsoft Office Division.

Updated on February 02, 2020

Comments

  • Brian Lyttle
    Brian Lyttle about 4 years

    On Mac OS X 10.5 I downloaded the latest version of Apache 2.2.9. After the usual configure, make, make install dance I had a build of apache without mod_rewrite. This wasn't statically linked and the module was not built in the /modules folder either.

    I had to do the following to build Apache and mod_rewrite:

    ./configure --prefix=/usr/local/apache2 --enable-rewrite=shared
    
    • Is there a way to tell Apache to build all modules as Shared Modules (DSOs) so I can control loading from the Apache config?
    • Now that I have built Apache and the mod_rewrite DSO, how can I build another shared module without building all of Apache?

    (The last time I built Apache (2.2.8) on Solaris, by default it built everything as a shared module.)

  • duleshi
    duleshi almost 9 years
    "all" doesn't really mean all! You should use ./configure --with-ldap --enable-mods-shared="all ssl ldap cache proxy authn_alias mem_cache file_cache authnz_ldap charset_lite dav_lock disk_cache" instead.