1. 미들웨어이야기/02. Apache

알아두면 유용한 apache httpd실행 옵션

알 수 없는 사용자 2014. 12. 3. 16:52

httpd는 아파치의 데몬 실행파일 입니다.

옵션을 통해 유용한 정보를 얻어 봅시다.


[아파치 conf파일 바꿔 기동하기]

./httpd -f /usr/local/apache/conf/httpd.conf

./httpd -f /usr/local/apache/conf/httpd_abc.conf

보통 기본 위치에 존재하는 httpd.conf를 이용하여 아파치를 실행하나,

두개 이상의 설정 파일을 두고 서비스마다 따로 띄운다거나 등에 사용할 때 유용합니다.

./httpd -f /usr/local/apache/conf/httpd.conf

root     32170     1  0 21:35 ?        00:00:00 ./httpd -f /usr/local/apache/conf/httpd.conf

nobody   32171 32170  0 21:35 ?        00:00:00 ./httpd -f /usr/local/apache/conf/httpd.conf

nobody   32172 32170  0 21:35 ?        00:00:00 ./httpd -f /usr/local/apache/conf/httpd.conf

nobody   32173 32170  0 21:35 ?        00:00:00 ./httpd -f /usr/local/apache/conf/httpd.conf

./httpd -f /usr/local/apache/conf/httpd_abc.conf

root     32170     1  0 21:35 ?        00:00:00 ./httpd -f /usr/local/apache/conf/httpd_abc.conf

nobody   32171 32170  0 21:35 ?        00:00:00 ./httpd -f /usr/local/apache/conf/httpd_abc.conf

nobody   32172 32170  0 21:35 ?        00:00:00 ./httpd -f /usr/local/apache/conf/httpd_abc.conf

nobody   32173 32170  0 21:35 ?        00:00:00 ./httpd -f /usr/local/apache/conf/httpd_abc.conf



[아파치 버전정보 확인]

[apache@abc:/apache/apache/bin]# ./httpd -V

Server version: Apache/2.2.24 (Unix)

Server built:   Jul  5 2013 15:26:13

Server's Module Magic Number: 20051115:31

Server loaded:  APR 1.2.7, APR-Util 1.2.7

Compiled using: APR 1.2.7, APR-Util 1.2.7

Architecture:   64-bit

Server MPM:     Prefork



[아파치 사용가능 모듈 확인]

[apache@abc:/apache/apache/bin]# ./httpd -l

Compiled in modules:

  core.c

  mod_authn_file.c

  mod_authn_default.c

  mod_authz_host.c

  mod_authz_groupfile.c

  mod_authz_user.c

  mod_authz_default.c

  mod_auth_basic.c

  mod_include.c

  mod_filter.c

  mod_log_config.c

  mod_env.c

  mod_setenvif.c


[설정된 가상호스트 확인]

[apache@abc:/apache/apache/bin]# ./httpd -S

VirtualHost configuration:

wildcard NameVirtualHosts and _default_ servers:

*:443                  is a NameVirtualHost

         default server aa.bbb..com (/apache/apache/conf/extra/httpd-ssl.conf:16)

         port 443 namevhost aa.bbb..com (/apache/apache/conf/extra/httpd-ssl.conf:16)

         port 443 namevhost bbb.ccc.com (/apache/apache/conf/extra/httpd-ssl.conf:39)

*:80                   is a NameVirtualHost

         default server aa.bbb..com (/apache/apache/conf/extra/httpd-vhosts.conf:3)

         port 80 namevhost aa.bbb..com (/apache/apache/conf/extra/httpd-vhosts.conf:3)

         port 80 namevhost bbb.ccc.com (/apache/apache/conf/extra/httpd-vhosts.conf:18)

Syntax OK


[conf파일 syntax 체크]

[apache@abc:/apache/apache/bin]# ./httpd -t

Syntax OK


[apache help옵션 확인]

[apache@abc:/apache/apache/bin]# ./httpd -h

Usage: ./httpd [-D name] [-d directory] [-f file]

               [-C "directive"] [-c "directive"]

               [-k start|restart|graceful|graceful-stop|stop]

               [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S]

Options:

  -D name            : define a name for use in <IfDefine name> 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

  -T                 : start without DocumentRoot(s) check


'1. 미들웨어이야기 > 02. Apache' 카테고리의 다른 글

Apache 로그 파일 관리  (0) 2014.12.03
Apache 설치  (0) 2014.12.03
apache graceful restart  (0) 2014.12.03
httpd 실행 옵션  (0) 2014.12.03
apache ab를 이용한 부하테스트  (0) 2014.12.03