How to check whether the Apache module is normal

Source: Internet
Author: User
Tags fully qualified domain name

How to check whether the Apache module is normal

In this article, we will briefly discuss the Apache server front-end and how to list or view the Enabled Apache modules. Apache is built based on the modular concept. This allows the web administrator to add different modules to expand main functions and enhance performance.
Common Apache modules include:

  1. Mod_ssl-Provides HTTPS functions.
  2. Mod_rewrite-you can use a regular expression to match the url style and use the. htaccess technique for transparent forwarding, or provide an HTTP status code response.
  3. Mod_security-protects Apache against brute-force or DDoS attacks.
  4. Mod_status-used to monitor Apache load and page statistics.


In Linux, apachectl or apache2ctl is used to control the Apache server, which is the front-end of Apache.

You can use the following command to display the apache2ctl usage information:

$ Apache2ctl help or $ apachectl help
Usage: /usr/sbin/httpd [-D name] [-d directory] [-f file]                       [-C "directive"] [-c "directive"]                       [-k start|restart|graceful|graceful-stop|stop]                       [-v] [-V] [-h] [-l] [-L] [-t] [-S]Options:  -D name            : define a name for use in  directives  -d directory       : specify an alternate initial ServerRoot  -f file            : specify an alternate ServerConfigFile  -C "directive"     : process directive before reading config files  -c "directive"     : process directive after reading config files  -e level           : show startup errors of level (see LogLevel)  -E file            : log startup errors to file  -v                 : show version number  -V                 : show compile settings  -h                 : list available command line options (this page)  -l                 : list compiled in modules  -L                 : list available configuration directives  -t -D DUMP_VHOSTS  : show parsed settings (currently only vhost settings)  -S                 : a synonym for -t -D DUMP_VHOSTS  -t -D DUMP_MODULES : show all loaded modules   -M                 : a synonym for -t -D DUMP_MODULES  -t                 : run syntax check for config files

Apache2ctl can work in two modes: SysV init mode and pass-through mode. In SysV init mode, apache2ctl uses the following simple single command format:

$ Apachectl command or $ apache2ctl command

For example, to start and check its status, run these two commands. If you are a common user, run the following command with the root user permission:

$ sudo apache2ctl start$ sudo apache2ctl status
tecmint@TecMint ~ $ sudo apache2ctl startAH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1/. Set the 'ServerName' directive globally to suppress this messagehttpd (pid 1456) already runningtecmint@TecMint ~ $ sudo apache2ctl statusApache Server Status for localhost (via 127.0.0.1)Server Version: Apache/2.4.18 (Ubuntu)Server MPM: preforkServer Built: 2016-07-14T12:32:26-------------------------------------------------------------------------------Current Time: Tuesday, 15-Nov-2016 11:47:28 ISTRestart Time: Tuesday, 15-Nov-2016 10:21:46 ISTParent Server Config. Generation: 2Parent Server MPM Generation: 1Server uptime: 1 hour 25 minutes 41 secondsServer load: 0.97 0.94 0.77Total accesses: 2 - Total Traffic: 3 kBCPU Usage: u0 s0 cu0 cs0.000389 requests/sec - 0 B/second - 1536 B/request1 requests currently being processed, 4 idle workers__W__.................................................................................................................................................Scoreboard Key:"_" Waiting for Connection, "S" Starting up, "R" Reading Request,"W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,"C" Closing connection, "L" Logging, "G" Gracefully finishing,"I" Idle cleanup of worker, "." Open slot with no current process

In pass-through mode, apache2ctl can use the following syntax to include all Apache parameters:

$ apachectl [apache-argument]$ apache2ctl [apache-argument]

You can use the following command to list all Apache parameters:

$ Apache2 help [In Debian-based systems] $ httpd help [in RHEL systems]

Therefore, to check which modules are started on your Apache server, run the appropriate commands in your release, -t-D DUMP_MODULES is an Apache parameter used to display all enabled modules:

--------------- In the Debian-based system --------------- $ apache2ctl-t-D DUMP_MODULES or $ apache2ctl-M
--------------- In the rhel system --------------- $ apachectl-t-D DUMP_MODULES or $ httpd-M $ apache2ctl-M
[root@tecmint httpd]# apachectl -MLoaded Modules: core_module (static) mpm_prefork_module (static) http_module (static) so_module (static) auth_basic_module (shared) auth_digest_module (shared) authn_file_module (shared) authn_alias_module (shared) authn_anon_module (shared) authn_dbm_module (shared) authn_default_module (shared) authz_host_module (shared) authz_user_module (shared) authz_owner_module (shared) authz_groupfile_module (shared) authz_dbm_module (shared) authz_default_module (shared) ldap_module (shared) authnz_ldap_module (shared) include_module (shared)....

That's it! In this simple tutorial, we explain how to use the Apache front-end tool to list started Apache modules.

From: https://linux.cn/article-7975-1.html

Address: http://www.linuxprobe.com/view-apache-module-normal.html


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.