Solved

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

Posted on 2007-12-03
1
524 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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.

705 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