The Computer Oracle

How to check which apache modules are enabled/installed?

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 2 Looping

--

Chapters
00:00 How To Check Which Apache Modules Are Enabled/Installed?
00:15 Accepted Answer Score 499
00:29 Answer 2 Score 127
00:42 Answer 3 Score 43
01:33 Answer 4 Score 34
01:57 Answer 5 Score 19
02:08 Thank you

--

Full question
https://superuser.com/questions/284898/h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#linux #ubuntu #apachehttpserver

#avk47



ACCEPTED ANSWER

Score 499


You're on Ubuntu so try:

apache2ctl -M



ANSWER 2

Score 127


httpd -M will tell you which modules are built-in or shared.




ANSWER 3

Score 43


Edit 2023: WARNING - use this with caution. See below.

Nothing from the answers above works if you can’t run commands on a remote server. If you have only “user” privileges or none at all try creating a test.php script:

<pre>
<?php
print_r(apache_get_modules());
?>
</pre>
    

Though, it will only work if PHP is installed as mod_php.


To explain warning part - seeing this to gain some popularity over the years I feel obligated to ask to look at the first comment below.

In short - exposing this information in public my hurt you. So any *.phpfile created for this trick should have random/hard-to-guess name and be deleted as quickly as possible after gathering neccessary info.




ANSWER 4

Score 34


Maybe this will help for some people on shared hosts with no access to httpd, apachectl or processes:

Enabled modules: ls /etc/apache2/mods-enabled/

Available modules: ls /etc/apache2/mods-available/




ANSWER 5

Score 19


You can also use apachectl

apachectl -t -D DUMP_MODULES