Question : Recently, I was learning how to secure Apache web server guide – in which one of the suggestion was to load only necessary modules in Apache, as that will reduce the server load and improves the web server security as well. I would like to know if there’s any command that will list all the modules that are enabled or loaded in Apache? I’m using RedHat enterprise Linux.
– Sanvi
Solution: List all Modules Loaded or Enabled in Apache httpd
Yes, there’s a command to list all the modules loaded by Apache.
On RHEL/CentOS:
$apachectl -t -D DUMP_MODULES
(or)
$httpd -M
On Ubuntu:
$ apache2ctl -M
Alternatively, you can verify the modules that are loaded in httpd configuration files.
# vi /etc/httpd/conf/httpd.conf
(or)
Also verify the files inside ‘/etc/httpd/conf.d/‘ and lookout for ‘LoadModule‘.
Similarly, PHP will load lot of modules. The below command will display all modules loaded by PHP.
#php -m