check which apache modules are enabled

How To Check Which Apache modules are enabled

Sometimes you may need to list Apache modules installed or find out which if an Apache module is enabled. Here’s how to check which Apache modules are enabled.

 

How To Check Which Apache modules are enabled

Here are the steps to check which Apache modules are enabled.

 

1. List Apache Modules

We will use apache2ctl -M command to list all the installed/enabled Apache modules. Apachectl is a linux command to control Apache web server. You can also use it to start and stop server.

Open terminal and run the following command to list all Apache enabled modules.

$ apache2ctl -M
Loaded Modules:
 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)
 ...

If the above command isn’t available or doesn’t work on your system, you can try any of the following commands

---------------  On Debian based systems --------------- 
$ apache2ctl -t -D DUMP_MODULES   

---------------  On RHEL based systems --------------- 
$ apachectl -t -D DUMP_MODULES   
OR 
$ httpd -M

Bonus Read : How to Fix 502 Bad Gateway Error in Apache

 

2. Check specific Apache modules

The above command will list all installed Apache modules. If you have many modules, the output will be a long list and it can be difficult to locate the desired module. So if you are looking for a specific Apache module, use grep to search for the required module in the output of apachectl -M

For example, if you want to check if mod_rewrite is enabled, use the following command

$ apache2ctl -M | grep rewrite
 rewrite_module (shared)

Bonus Read : How to Increase Request Timeout in Apache

Ubiq makes it easy to visualize data in minutes, and monitor in real-time dashboards. Try it Today!