Pages

Subscribe:

Sunday, January 11, 2015

Adding a new module in Apache Server

Adding and Compiling a new module in Apache Server


The following steps are required for adding up a new module (DSO) to the Apache Web Server:
If you have your own module, you can add it to the "httpd.conf" file, so that it is compiled in and loaded as a DSO (Dynamic Shared Objects).
For the successful compilation of the shared module, please check the installation of the "apache-devel" package because it installs the include files, the header files and the Apache eXtenSion (APXS) support tools.


Steps to proceed:


1. Download the required module tarball from the internet using wget command to the /tmp directory of the server.
2. Untar the tarball: cd into that directory and issue the following commands :
$ /path/to/apxs -c mod_foo.c
$ /path/to/apxs -i -a -n foo mod_foo.so
Then edit the "httpd.conf" file and add the following lines in the respective sections for loading the module whenever Apache restart.
(taking example of compiled module mod_foo)
LoadModule mod_foo modules/mod_foo.so
AddModule mod_foo.c
Once this is done, we need to restart the Apache Web Server.

0 comments:

Post a Comment