Website-Suche

So listen Sie alle derzeit aktivierten apache2-Module auf dem Linux-Server auf


Frage:

Wie kann ich alle derzeit aktivierten Module mit dem Apache2-Webserver auflisten?

Antwort:

Mit dem Befehl apache2ctl und einer Kombination aus -M können Sie alle geladenen Apache-Module auf Ihrem System auflisten. Zum Beispiel listet der folgende Linux-Befehl alle geladenen Module in separaten Zeilen auf:


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)
 alias_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 filter_module (shared)
 geoip_module (shared)
 mime_module (shared)
 mpm_event_module (shared)
 negotiation_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 status_module (shared) 

Eine weitere Alternative zum obigen Befehl ist:


apache2ctl -t -D DUMP_MODULES

Eine andere, aber weniger zuverlässige Alternative besteht darin, alle aktivierten Module in /etc/apache2/mods-enabled/ aufzulisten.


ls /etc/apache2/mods-enabled/
access_compat.load  auth_basic.load  authz_core.load  autoindex.conf  deflate.load  env.load     geoip.load  mpm_event.conf    negotiation.load  setenvif.load
alias.conf          authn_core.load  authz_host.load  autoindex.load  dir.conf      filter.load  mime.conf   mpm_event.load    rewrite.load      status.conf
alias.load          authn_file.load  authz_user.load  deflate.conf    dir.load      geoip.conf   mime.load   negotiation.conf  setenvif.conf     status.load

Alle oben aufgeführten Module sind aktiviert, dürfen aber noch nicht geladen werden, da sie nur einen symbolischen Link zu den entsprechenden Gegenstücken darstellen, die sich in /etc/apache2/mods-available/ befinden. Zum Beispiel:


ls -l /etc/apache2/mods-enabled/rewrite.load 
lrwxrwxrwx. 1 root root 30 Jun 23 02:32 /etc/apache2/mods-enabled/rewrite.load -> ../mods-available/rewrite.load

Wenn Sie nach einem bestimmten geladenen Modul suchen, leiten Sie einfach Ihr STDOUT vom apache2ctl-Befehl zum grep-Befehl um. Lassen Sie uns zum Beispiel suchen, ob die Module rewrite und alias derzeit geladen sind:


apache2ctl -M | grep -E "rewrite|alias"
 alias_module (shared)
 rewrite_module (shared)

Aus der obigen Ausgabe können wir sehen, dass sowohl Rewrite- als auch Alias-Apache-Module geladen werden.

Verwandte Artikel: