APACHE Compiling Modules (DSO): Difference between revisions

From UNIX Systems Administration
Jump to navigation Jump to search
m (Michael Kohler moved page APACHE Compiling Modules to APACHE Compiling Modules (DSO) without leaving a redirect)
Line 2: Line 2:
=== Quick Compile ===
=== Quick Compile ===
# Compile all modules.
# Compile all modules.
## <tt>'''find . -name '*.c' -exec gcc -fpic -DSHARED_MODULE -I/<path to apache include directory>/include -c {} \;'''</tt>
#: <tt>'''find . -name '*.c' -exec gcc -fpic -DSHARED_MODULE -I/<path to apache include directory>/include -c {} \;'''</tt>


=== Long Compile ===
=== Long Compile ===

Revision as of 21:08, 13 December 2017

Compiling Modules (DSO)

Quick Compile

  1. Compile all modules.
    find . -name '*.c' -exec gcc -fpic -DSHARED_MODULE -I/<path to apache include directory>/include -c {} \;

Long Compile

  1. Compile each module individually.
    1. gcc -fpic -DSHARED_MODULE -I/usr/local/apache2/include -c <module>.c

Linking Modules (DSO)

  1. Link the object code to a shareable module.
    1. # ld -Bshareable -o <module>.so <module>.o
  2. Copy the module to the live path of Apache.
    1. # cp mod_foo.so /path/to/apache/modules/<module>.so
  3. Change the permissions of the module.
    1. # chmod 755 /path/to/apache/modules/<module>.so

Further Reading