?
Solved

How to compile and add new module to a running apache?

Posted on 2007-12-03
1
Medium Priority
?
536 Views
Last Modified: 2010-03-04
My web server running apache 2.2.6 (Redhat ES4) with proper configuration. Now I want to add new modules: mod_expires, mod_headers, mod_deflate

I did some search and know there're 2 methods:

1. Use gcc to compile necessary modules from source to .so file, and use LoadModule directive.
2. Recompile apache with some options to keep existing configurations and add new modules.

Could you help me with detail instructions of 2 methods?
0
Comment
Question by:laitt
1 Comment
 
LVL 7

Accepted Solution

by:
Wod earned 1500 total points
ID: 20396904
1) Build and install a third-party Apache module, say mod_foo.c, into its own DSO mod_foo.so outside of the Apache source tree using apxs:

# apxs -c mymodule.c
# apxs -i -a -n mymodule mymodule.la

Then open your httpd.conf file and add mymodule using top LoadModule Directive:

# vi  httpd.conf

Append following line to server config context (this means that the directive may be used in the server configuration files (e.g., httpd.conf), but not within any or containers. It is not allowed in .htaccess files at all).

LoadModule mymodule /usr/lib/httpd/modules/mymodule.so

If you find compile and install procdure difficult to use then try Apachetoolbox (http://www.cyberciti.biz/tips/installing-apache-php-and-modules-easily-with-apachetoolbox.html) utility to install your Apache modules easily. See official Apache documentation (http://httpd.apache.org/docs/2.2/dso.html) for more information.


2) Compiling apache http://tldp.org/HOWTO/Apache-Compile-HOWTO/
there is too much stuff to cover, you should read the link above if you plan to recompile apache
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month14 days, 5 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question