HTTPD –L은 다음과 같습니다.
-L Output a list of directives together with expected argu-ments and places where the directive is valid.
[e61128 /usr/local/apache/bin]# httpd -L > module
아파치에서 사용하는 directive와 directive를 포함하는 모듈과의 상관관계와 설명이 나와있습니다.
...
<Directory (core.c) Container for directives affecting resources located in the specified directories Allowed in *.conf only outside <Directory>, <Files> or <Location>
....
|
Httpd –l 이 static module list를 알려주는 것입니다.
-l Output a list of modules compiled into the server.
[e61128 /usr/local/apache/bin]# httpd -l
Compiled in modules:
core.c
mod_access.c
mod_auth.c
mod_include.c
mod_log_config.c
mod_env.c
mod_setenvif.c
prefork.c
http_core.c
mod_mime.c
mod_status.c
mod_autoindex.c
mod_asis.c
mod_cgi.c
mod_negotiation.c
mod_dir.c
mod_imap.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_so.c |
우리가 보던 설정파일 httpd.conf의 내용중 Dynamic Shared Object는 위의 httpd –l 리스트에 나오면 안나오도록 설계가 되어 있죠.
#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
Include conf/mod_charset.conf
Include conf/mod_deflate.conf
Include conf/mod_dosevasive20.conf
Include conf/mod_headers.conf
Include conf/mod_jk.conf
Include conf/mod_proxy.conf
Include conf/mod_proxy_connect.conf
Include conf/mod_proxy_ftp.conf
Include conf/mod_proxy_http.conf
Include conf/mod_rewrite.conf
Include conf/mod_security.conf
Include conf/mod_url.conf |
즉, LoadModule.conf파일의 경우는 Load를 하되. Load가 되면, forcecharset을 먹이라는 뜻이죠.
LoadModule charset_module modules/mod_charset.so
<IfModule mod_charset.c>
ForceCharset KSC5601
</IfModule> |
모듈 리스트에는 mod_charset.c이 포함되어 있습니다.
[e61128 /usr/local/apache/modules]# ll
ÇÕ°è 1388
drwxr-xr-x 2 www www 4096 8¿ù 31 15:45 .
drwxr-xr-x 15 www www 4096 8¿ù 31 15:45 ..
-rw-r--r-- 1 www www 8504 8¿ù 31 15:44 httpd.exp
-rwxr-xr-x 1 www www 26687 8¿ù 31 15:45 mod_charset.so
-rwxr-xr-x 1 www www 22892 8¿ù 31 15:45 mod_comicsession2.so
-rwxr-xr-x 1 www www 38228 8¿ù 31 15:45 mod_deflate.so
-rwxr-xr-x 1 www www 36115 8¿ù 31 15:45 mod_dosevasive20.so
-rwxr-xr-x 1 www www 35061 8¿ù 31 15:45 mod_headers.so
-rwxr-xr-x 1 www www 462702 8¿ù 31 15:45 mod_jk.so
-rwxr-xr-x 1 www www 177095 8¿ù 31 15:45 mod_nvidsession.so
-rwxr-xr-x 1 www www 96087 8¿ù 31 15:45 mod_proxy.so
-rwxr-xr-x 1 www www 26845 8¿ù 31 15:45 mod_proxy_connect.so
-rwxr-xr-x 1 www www 67218 8¿ù 31 15:45 mod_proxy_ftp.so
-rwxr-xr-x 1 www www 64674 8¿ù 31 15:45 mod_proxy_http.so
-rwxr-xr-x 1 www www 115709 8¿ù 31 15:45 mod_rewrite.so
-rwxr-xr-x 1 www www 152415 8¿ù 31 15:45 mod_security.so
-rwxr-xr-x 1 www www 21083 8¿ù 31 15:45 mod_url.so |
만약 mod_charset.so 파일이 없는 상태에서, httpd restart를 하면 다음의 결과가 나옵니다.
[e65004 /usr/local/apache/modules]# mv mod_charset.so mod_charset1.so
[e65004 /usr/local/apache/modules]# ../bin/httpd -k graceful
Syntax error on line 2 of /usr/local/apache/conf/mod_charset.conf:
Cannot load /usr/local/apache/modules/mod_charset.so into server: /usr/local/apache/modules/mod_charset.so: cannot open shared object file: No such file or directory |
참고하세요.
결론은…
즉, 정적인 모듈은 httpd –l 로 확인할 수 있고, 동적인 모듈은 LoadModule시 에러가 나지 않으면 동적으로 로딩됨을 확인이 가능합니다.