Linux에서 활성화 /로드 된 Apache 모듈을 확인하는 방법
이 가이드에서는 Apache 웹 서버 프런트 엔드와 서버에서 활성화 된 Apache 모듈을 나열하거나 확인하는 방법에 대해 간략하게 설명합니다.
Apache는 모듈화 원칙을 기반으로 구축되어 웹 서버 관리자가 다른 모듈을 추가하여 주요 기능을 확장하고 Apache 성능을 향상시킬 수 있습니다.
일반적인 Apache 모듈 중 일부는 다음과 같습니다.
- mod_ssl – which offers HTTPS for Apache.
- mod_rewrite – which allows for matching url patterns with regular expressions, and perform a transparent redirect using .htaccess tricks, or apply a HTTP status code response.
- mod_security – which offers you to protect Apache against Brute Force or DDoS attacks.
- mod_status – that allows you to monitor Apache web server load and page statics.
Linux에서 apachectl 또는 apache2ctl 명령은 Apache HTTP 서버 인터페이스를 제어하는 데 사용되며 Apache에 대한 프론트 엔드입니다.
apache2ctl의 사용 정보를 아래와 같이 표시 할 수 있습니다.
$ 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은 Sys V init 모드와 통과 모드의 두 가지 가능한 모드에서 작동 할 수 있습니다. SysV init 모드에서 apache2ctl은 아래 형식의 간단한 한 단어 명령을 사용합니다.
$ apachectl command OR $ apache2ctl command
예를 들어 Apache를 시작하고 상태를 확인하려면 일반 사용자 인 경우 sudo 명령을 사용하여 루트 사용자 권한으로 다음 두 명령을 실행합니다.
$ sudo apache2ctl start $ sudo apache2ctl status
[email protected] ~ $ sudo apache2ctl start AH00558: 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 message httpd (pid 1456) already running [email protected] ~ $ sudo apache2ctl status Apache Server Status for localhost (via 127.0.0.1) Server Version: Apache/2.4.18 (Ubuntu) Server MPM: prefork Server Built: 2016-07-14T12:32:26 ------------------------------------------------------------------------------- Current Time: Tuesday, 15-Nov-2016 11:47:28 IST Restart Time: Tuesday, 15-Nov-2016 10:21:46 IST Parent Server Config. Generation: 2 Parent Server MPM Generation: 1 Server uptime: 1 hour 25 minutes 41 seconds Server load: 0.97 0.94 0.77 Total accesses: 2 - Total Traffic: 3 kB CPU Usage: u0 s0 cu0 cs0 .000389 requests/sec - 0 B/second - 1536 B/request 1 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
그리고 통과 모드에서 작동 할 때 apache2ctl은 다음 구문의 모든 Apache 인수를 사용할 수 있습니다.
$ apachectl [apache-argument] $ apache2ctl [apache-argument]
모든 Apache 인수는 다음과 같이 나열 될 수 있습니다.
$ apache2 help [On Debian based systems] $ httpd help [On RHEL based systems]
따라서 Apache 웹 서버에서 어떤 모듈이 활성화되어 있는지 확인하려면 배포에 대해 아래에서 해당 명령을 실행하십시오. 여기서 -t -D DUMP_MODULES
는 활성화 /로드 된 모든 모듈을 표시하는 Apache 인수입니다. ":
--------------- On Debian based systems --------------- $ apache2ctl -t -D DUMP_MODULES OR $ apache2ctl -M
--------------- On RHEL based systems --------------- $ apachectl -t -D DUMP_MODULES OR $ httpd -M $ apache2ctl -M
[[email protected] httpd]# apachectl -M Loaded 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) ....
그게 다야! "이 간단한 자습서에서는 Apache 프런트 엔드 도구를 사용하여 활성화 /로드 된 아파치 모듈을 나열하는 방법을 설명했습니다. 이 가이드에 대한 질문이나 의견을 보내려면 아래 피드백 양식을 사용하여 연락 할 수 있습니다.