아파치 설정파일 httpd.conf, apache2.conf 위치 확인

Jmnote (토론 | 기여)님의 2013년 12월 2일 (월) 01:06 판 (Jmnote 사용자가 Httpd.conf 폴더 문서를 Httpd.conf의 위치 문서로 옮기면서 넘겨주기를 덮어썼습니다)

httpd.conf 위치 알아내기, 찾기
httpd.conf 폴더
/etc/httpd/conf/

1 방법 1(egrep)

명령어
httpd -V | egrep "(HTTPD\_ROOT|SERVER\_CONFIG\_FILE)"
실행예시
[root@jmnote ~]# httpd -V | egrep "(HTTPD\_ROOT|SERVER\_CONFIG\_FILE)"
 -D HTTPD_ROOT="/etc/httpd"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"
→ 두 행을 조합하면 /etc/httpd/conf/httpd.conf

2 방법 2(raw)

명령어
httpd -V
실행예시
[root@jmnote ~]# httpd -V
Server version: Apache/2.2.3
Server built:   Oct 20 2011 17:00:12
Server's Module Magic Number: 20051115:3
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
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

→ HTTPD_ROOT는 /etc/httpd 이고, SERVER_CONFIG_FILE은 conf/httpd.conf 이므로 조합하면 /etc/httpd/conf/httpd.conf 이다.

3 파일 보기

[root@jmnote ~]# ll /etc/httpd/conf/httpd.conf
-rw-r--r-- 1 root root 35569 Feb 25 16:04 /etc/httpd/conf/httpd.conf
[root@jmnote ~]# cat /etc/httpd/conf/httpd.conf | head -4
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2/> for detailed information.

4 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}