httpd.conf 설명 (간단 예시/ 문제풀이)

httpd.conf 설명 (간단 예시/ 문제풀이)

ServerRoot "/etc/httpd" httpd가 구성파일에서 참조된 파일을 찾는 위치 지정 (아파치 서버의 루트 디렉토리)

Listen 80 모든 인터페이스의 80/tcp 포트에서 수신 대기

Include conf.modules.d/*.conf ServerRoot 에 상대적으로 파일의 경로를 지정하여 포함시킬 수 있다.

User apache root권한이 필요한 모든 작업 후 해당 유저, 그룹으로 작업 수행

Group apache ex) 자식 프로세스가 생성될때 해당 프로세스의 소유자와 소유 그룹은 apache 이다.

ServerAdmin root@localhost httpd 오류 관련 메일을 받을 수 있는 주소 설정

지정된 디렉터리 및 하위 디렉터리에 대한 구성 지시문 설정

AllowOverride none .htaccess 파일에서 디렉터리별 구성 설정 확인되지 않음

Require all denied httpd는 이 디렉터리의 콘텐츠를 제공하는것을 거부한다.

DocumentRoot "/var/www/html" httpd가 요청된 파일을 검색할 위치 지정(아파치 웹 문서들의 루트 디렉터리)

AllowOverride None

Require all granted 이 디렉터리에 대한 엑세스 허용

Options Indexes FollowSymLinks 디렉터리에 대해 특정 옵션 설정, indexes 옵션은 디렉터리가 요청되고 해당 디렉터리에

index.html이 없을 경우 디렉터리 목록 표시

AllowOverride None

Require all granted

지정된 확장 모듈이 로드되는 경우에만 해당 콘텐츠 적용

DirectoryIndex index.html 디렉터리가 요청될 때 사용할 파일 지정

지정된 파일에 대해 구성 지시문 설정

Require all denied

ErrorLog "logs/error_log" 발생하는 오류를 로깅할 위치 설정 (상대경로 이므로 앞에 ServerRoot지시문이 붙음)

LogLevel warn

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

LogFormat "%h %l %u %t \"%r\" %>s %b" common

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

CustomLog "logs/access_log" combined 로깅할 파일과 LogFormat 지시문으로 관리자가 필요한 정보를 로깅

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

AddDefaultCharset UTF-8 text/plain 및 text/html 리소스의 Content-type 헤더에 charset 부분 추가

IncludeOptional conf.d/*.conf Include와 유사하나 지정한 파일이 없어도 오류가 발생하지 않음

ErrorDocument 403 /forbidden.html 허가 거부된 페이지에 접근할 때 제공되는 페이지

ErrorDocument 401 /unauth.html

ErrorDocument 404 /not_found.html

from http://jungtak.tistory.com/280 by ccl(A) rewrite - 2021-10-26 09:26:56