Some one posted about, "What is Modules in Linux and how to add it in apache," on our forum. Therefore, I decided to create a small howto for adding new modules under Apache. The Apache HTTP Server is a modular program. So as a UNNIX/Linux administrator you can choose the functionality to include in the server by selecting a set of modules (or features via modules).
A module provides variety of features for apache such as security, perl and php support etc. To configure apache for additional modules you need to add LoadModule directive in httpd.conf or modules.conf file. For example you can add session management and tracking through consistent identifiers using mod_session. You need to add following entry to Apache 1.3.xx server (under Debian Linux you need to add to /etc/apache-perl/modules.conf file):
LoadModule auth_module /usr/lib/apache/1.3/mod_session.so
Please note that your Apache server must configure for Dynamic Shared Objects (DSOs). Let us assume you have downloaded the module called mymodule.c and you would like to compile and use this module, then you can use Apache apxs utility to compile and install this module:
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 utility to install your Apache modules easily. See official Apache documentation for more information.
If you are a Web developer then do not forget to check out book review of PHP Hacks Tips & Tools for Creating Dynamic Websites.
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop










{ 2 comments… read them below or add one }
Surely this is very useful for all kinds of people who is working on apache. I appreciate this kind of how to documents.
Good info…
But need 2 add more details regarding
How to add a module as static
Thanks cyberciti u r helping me very much in my daily system works….