Solved

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

Posted on 2007-12-03
1
513 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

919 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

16 Experts available now in Live!

Get 1:1 Help Now