1.10. Working with Apache modules
The httpd service is a modular application, and you can extend it with a number of Dynamic Shared Objects (DSOs). Dynamic Shared Objects are modules that you can dynamically load or unload at runtime as necessary. You can find these modules in the /usr/lib64/httpd/modules/ directory.
1.10.1. Loading a DSO module 링크 복사링크가 클립보드에 복사되었습니다!
As an administrator, you can choose the functionality to include in the server by configuring which modules the server should load. To load a particular DSO module, use the LoadModule directive. Note that modules provided by a separate package often have their own configuration file in the /etc/httpd/conf.modules.d/ directory.
Prerequisites
-
You have installed the
httpdpackage.
Procedure
Search for the module name in the configuration files in the
/etc/httpd/conf.modules.d/directory:# grep mod_ssl.so /etc/httpd/conf.modules.d/*Edit the configuration file in which the module name was found, and uncomment the
LoadModuledirective of the module:LoadModule ssl_module modules/mod_ssl.soIf the module was not found, for example, because a RHEL package does not provide the module, create a configuration file, such as
/etc/httpd/conf.modules.d/30-example.confwith the following directive:LoadModule ssl_module modules/<custom_module>.soRestart the
httpdservice:# systemctl restart httpd
1.10.2. Compiling a custom Apache module 링크 복사링크가 클립보드에 복사되었습니다!
You can create your own module and build it with the help of the httpd-devel package, which contains the include files, the header files, and the APache eXtenSion (apxs) utility required to compile a module.
Prerequisites
-
You have the
httpd-develpackage installed.
Procedure
Build a custom module with the following command:
# apxs -i -a -c module_name.c
Verification
- Load the module the same way as described in Loading a DSO module.