Solved

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

Posted on 2007-12-03
1
511 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 500 total points
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now