Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux技術

如何查看 Apache 模塊是否正常

Apache 基於模塊化理念構建,管理員可透過不同模塊擴展功能、增強性能。本文說明如何列出並查看已啟用的 Apache 模塊。

常見模塊包括:mod_ssl(HTTPS)、mod_rewrite(URL 重寫)、mod_security(防暴力破解與 DDoS)、mod_status(負載與頁面統計監測)等。

如何查看 Apache 模塊是否正常

apache2ctl 前端工具

apachectl / apache2ctl 是控制 Apache 的前端,可查看說明:

$ apache2ctl help  或  $ apachectl help

它可工作在 SysV init 模式或直通模式。啟動並查看狀態:

$ sudo apache2ctl start
$ sudo apache2ctl status

列出已啟用的模塊

-t -D DUMP_MODULES 是顯示所有已啟用模塊的參數(等同 -M):

# Debian 系
$ apache2ctl -t -D DUMP_MODULES  或  $ apache2ctl -M
# RHEL 系
$ apachectl -t -D DUMP_MODULES  或  $ httpd -M

輸出會列出 core_module、mpm_prefork_module、auth_basic_module、ldap_module 等已載入模塊。

Copyright © Linux教程網 All Rights Reserved