플밍

httpd.conf 나름 분석한것 본문

프로그래밍/Linux

httpd.conf 나름 분석한것

너구리안주 2010. 12. 30. 12:41

#ads_1

#***************************************************************************

#    Section 1: Global Environment (아파치 전체적인 영향이 미치는 설정)

#***************************************************************************


# 요청에 대해 응답할때 Header에 서버정보를 제공하는 옵션 (정보를 적게 주는것이 보안에 좋음)

# Prod : 웹서버 종류

# Min : 웹서버 종류, 마이너버전까지

# Major : 웹서버 종류, 메이저버전까지

# OS : 웹서버 종류, 버전, 운영체제의 종류

# Full : 웹서버 종류, 버전, 운영체제의 종류, 설치된 모듈 등

ServerTokens OS


# 아파치가 설치된 루트경로

ServerRoot "/etc/httpd"


# 아파치가 구동될때 부모 httpd 프로세스의 프로세스ID를 저장한다.

# 서버를 재시작하거나 죽일때 아이디를 알아야 하기때문에 저장해 두는 것이다

# 이 저장경로를 지정

PidFile run/httpd.pid


# 요청에 대한 응답 시간 제한

Timeout 120


# 접속한 한유저에 대해서 요청에 대한 자료를 모두 전송하고 접속을 끊을것인가 여부

# 접속자가 많지만 메모리가 충분하다 : On

# 접속자가 많지만 메모리 여유가 없다 : Off

# 접속자가 적고 메모리가 충분하다 : On

# 접속자가 적고 메모리 여유가 없다 : Off

# MaxClient 값에 도달해도 swap 메모리를 사용하지 않는 상태가 메모리가 충분한 상태이다

KeepAlive Off


# 접속한 클라이언트의 이어지는 요청을 몇번까지 처리하고 끊을것인가

# KeepAlive On 일때만 유효하다

MaxKeepAliveRequests 100


# 이어지는 요청이 몇초간 없을때 끊을 것인가

# KeepAlive On 일때만 유효하다

KeepAliveTimeout 15


##

## Server-Pool Size Regulation (MPM specific)

##



# MPM 설정 (Multi-Processing Module) S ==============================================

# 프로세스 분배 방식

# 아파치가 받아들인 요청을 처리하기 위해 'child processess'에게 분배하는 방식

# worker 와 prefork 두가지가 있다.

# worker : child process 1개당 thread n개

# prefork : child process 1개당 thread 1개

# 차이점

# 메모리 사용량 : worker < prefork

# 통신량이 많은 서버 : worker 사용

# 속도는 두방식이 비슷함

# prefork 는 안전하지 않은 제 삼자가 만든 모듈을 사용할 수 있음

# prefork 는 디버깅 지원이 빈약한 플랫폼에서 쉽게 디버깅할 수 있음



# 전통적인 처리 방식

# 5~10개 사이의 놀고있는 프로세스(Idle Processor)를 띄워놓는건

# 생성 소멸 작업때문에 부하가 날수있기때문

# 미리 생성해 놓으면 바로바로 처리할 수도 있고 요청을 쪼개서 할당하는식으로

# 자원을 효율적으로 활용할 수 있음

<IfModule prefork.c>

StartServers       8 # 아파치 데몬이 시작될 때 미리 생성해 놓을 자식 프로세스 수

MinSpareServers    5 # 여분 프로세스가 이 개수보다 적으면 추가로 생성

MaxSpareServers   20 # 여분 프로세스가 이 개수보다 많으면 소멸시킴

ServerLimit      256 # 서버 프로세스의 최대개수

MaxClients       256 # 클라이언트 동시접속 최대 수 (중요)

MaxRequestsPerChild  4000 # 한 쓰레드가 받아들일 수 있는 최대 요청수, 초과시 종료되고 재시작

</IfModule>


# worker MPM

# StartServers: initial number of server processes to start

# MaxClients: maximum number of simultaneous client connections

# MinSpareThreads: minimum number of worker threads which are kept spare

# MaxSpareThreads: maximum number of worker threads which are kept spare

# ThreadsPerChild: constant number of worker threads in each server process

# MaxRequestsPerChild: maximum number of requests a server process serves

# 요즘 많이 사용하는 방식

<IfModule worker.c>

StartServers         2 # 아파치 데몬이 시작될 때 미리 생성해 놓을 자식 프로세스 수

MaxClients         150 # 클라이언트 동시 접속 최대 수

MinSpareThreads     25 # 여분 쓰레드가 이 개수보다 적으면 추가로 생성

MaxSpareThreads     75 # 여분 쓰레드가 이 개수보다 많으면 소멸시킴

ThreadsPerChild     25 # 한 프로세스당 쓰레드 수

MaxRequestsPerChild  0 # 한 쓰레드의 최대 요청 처리개수 초과시 쓰레드 종료, 0이면 종료안함

</IfModule>

# MPM 설정 (Multi-Processing Module) E ==============================================



# 아파치가 사용할 특정아이피 또는 포트번호

# 80, 8080 을 둘다 쓰려면 아래같이 중복선언하면 된다

# Listen 80

# Listen 8080

#Listen 12.34.56.78:80

Listen 80



# 사용할 모듈들 로드

# 예 :

# LoadModule foo_module modules/mod_foo.so


LoadModule auth_basic_module modules/mod_auth_basic.so

LoadModule auth_digest_module modules/mod_auth_digest.so

LoadModule authn_file_module modules/mod_authn_file.so

..........


# 기타 설정 파일 로드 (php.conf, ssl.conf 등)

Include conf.d/*.conf


# mod_status.c 모듈을 로드하면

# http://www.yourdomain.co.kr/server-status 여기서 서버를 모니터할 수 있는데

# 아주 자세한 상황까지 일일이 다 모니터하려면 On 을 하고

# 대략적인 상황만 모니터 하려면 Off 한다.

# On 하면 느려질 수 있음

#ExtendedStatus On


# apache라는 Group의 apache 라는 User 로 웹서버를 실행한다

User apache

Group apache





#***************************************************************************

#    Section 2: 'Main' server configuration (주 서버에 대한 설정)

#***************************************************************************

# 아파치서버에 문제가 발생했을 경우 에러메일을 보낼 시스템관리자 이메일주소

ServerAdmin root@localhost


#

# ServerName gives the name and port that the server uses to identify itself.

# This can often be determined automatically, but we recommend you specify

# it explicitly to prevent problems during startup.

#

# If this is not set to valid DNS name for your host, server-generated

# redirections will not work.  See also the UseCanonicalName directive.

#

# If your host doesn't have a registered DNS name, enter its IP address here.

# You will have to access it by its address anyway, and this will make

# redirections work in a sensible way.

#

#ServerName www.example.com:80



# cgi나 php등에서 SERVER_NAME, SERVER_PORT 등의 변수값을 넘길때

# ON 으로 설정되어있을경우에는 상단의 ServerName이 넘겨지고

# OFF 로 설정되어 있으면 요청한 호스트명과 포트명이 넘겨진다.

# 예를 들어 ServerName이 www.xxx.com 이고 abc.xxx.com 이 요청되었을경우

# ON 이면 www.xxx.com 이 OFF 이면 abc.xxx.com 이 넘겨진다


UseCanonicalName Off


# 기본 홈페이지의 경로지정

#DocumentRoot "/var/www/html"

DocumentRoot "/home/focusinfo/public_html"





##############################################################################

# <Directory /> 디렉토리 옵션

##############################################################################

# Directory : 아파치가 접근할 수 있는 각 디렉토리에 대해 어떤 서비스와 기능을

# 허용하고 거부할 것인지를 설정한다.  설정된 디렉토리의 서브디렉토리에도 영향을 미친다

# 옵션의 예

# None : 어떤 옵션도 이용할 수 없다

# All : 모든 명령을 이용할 수 있다.(MultiViews 는 제외)

# Indexes : URL에 지정된 디렉토리에 지정된 파일이 없을경우 파일 목록을 보여준다(보안상 좋지않다)

# Includes : 추가적인 정보를 인클루드한다

# IncludesNoExec : 추가적인 정보를 인클루드하지만 실행파일을 실행하는것은 방지한다(#exec, include)

# FollowSymLinks : 디렉토리에서 심볼릭 링크를 허용한다

# ExecCGI : CGI 스크립트를 실행을 허용한다

# MultiViews : 요청에 따라 적절하게 페이지를 보여준다.

#   http 헤드 정보가 Accept-Language:ko 라면 Korea 언어에 맞게 데이터를 클라이언트에 전송한다.

# Order : 서버가 access 컨트롤을 수행하는 순서를 지정한다.

#   예) Order allow,deny (allow 기능을 먼저 수행하고 deny 기능을 수행한다)

# Allow from : 나열되는 주소들에 대한 access 컨트롤을 허용한다

#   예) Allow from all [222.xxx.xxx.xxx 222.xxx.xxx.xxx alov.co.kr]

# Deny from : 나열되는 주소들에 대한 access 컨트롤을 제한한다

#   예) Deny from all [222.xxx.xxx.xxx 222.xxx.xxx.xxx alov.co.kr]

# require : 사용자그룹에 대한 접근을 통제한다

#   require user [group vaild-user] <ID>

#   user - 지정된 사용자들에게만 접근 허용. AuthUserFile에서 지정

#   group - 지정된 그룹에게만 접근을 허용. AuthGroupFile에서 지정

#   valid-user - AuthUserFile에 있는 모든 사용자 들에게 접

# SymLinksIfOwnerMatch : 심볼릭 링크를 허용하지만 사용자소유로 되어 있는것만 허용한다

# AllowOverride : AccessFileName 에 설정한 파일(.htaccess) 에 대한 권한 설정

#   All : 모든것 허용

#   AuthConfig : 사용자 인증 지시자 사용 허용

#                AuthDBMGroupFile, AuthDBMUserFile, AuthGroupFile, AuthName, AuthType,

#                AuthUserFile, required 등

#   FileInfo : 문서유형을 제어하는 지시자 사용 허용

#                AddEncoding, AddLanguage, AddType, DefaultType, ErrorDocument, LanguagePriority 등

#   Indexes : 디렉토리 인덱싱을 제어하는 지시자 사용 허용

#                AddDescription, AddIcon, AddIconByEncoding, AddIconByType, DefaultIcon,

#                DirectoryIndex, FancyIndexing, HeaderName, IndexIgnore, IndexOptions, ReadmeName 등

#   Limit : 호스트 접근을 제어하는 지시자 허용

#                Allow, Deny, order 등

#   Options : Options, XBiHack 등과 같은 지시자 사용을 허용

# <Limit> 블럭 : IP나 ID/PW 같은 인증을 거친 사용자에게 허용하는 메쏘드

# <LimitExcept> 블럭 : 인증을 거치지 않은 사용자에게 허용하는 메쏘드



# 시스템 루트에 대한 설정

<Directory />

Options FollowSymLinks # 심볼릭 링크 허용

AllowOverride None # .htaccess 를 허용하지 않음

</Directory>


#ads_1


# mod_userdir 모듈을 사용하면 http://exam.com/~user/ 식으로 사용자별 디렉토리에 접근할 수 있다

<IfModule mod_userdir.c>

UserDir disable

</IfModule>



#<Directory /home/*/public_html>

#    AllowOverride FileInfo AuthConfig Limit

#    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec

#    <Limit GET POST OPTIONS>

#        Order allow,deny

#        Allow from all

#    </Limit>

#    <LimitExcept GET POST OPTIONS>

#        Order deny,allow

#        Deny from all

#    </LimitExcept>

#</Directory>



# 요청되는 URL에 파일명이 없을경우 찾아볼 파일들 (첫번째로 찾은걸 보여준다)

DirectoryIndex index.html index.php index.html.var index.htm


# 아파치 설정을 Override 할 수 있도록 하는 파일명

AccessFileName .htaccess


# 바로위 .htaccess 파일의 내용을 볼수없게 할때 사용하는 옵션

# .ht 로 시작하는 파일의 보이는것을 막음

<Files ~ "^\.ht">

Order allow,deny

Deny from all

</Files>


# 웹서버의 mime type 을 지정한 파일의 위치.

# mime.types 파일은 서버에 의해 리턴될 수 있는 파일명과 mime형식을 기술해 놓은 파일이다.

TypesConfig /etc/mime.types


# 위의 mime.types 에 지정되어 있지 않은 파일형식에 대한 요청을 받았을때

# 알수없는 문서타입에 대해 사용할 기본 mime 타입을 지정

DefaultType text/plain



# 파일의 내용으로 mime type 의 힌트를 얻는 기능을 하는 모듈.  모듈의 위치를 지정

<IfModule mod_mime_magic.c>

#   MIMEMagicFile /usr/share/magic.mime

MIMEMagicFile conf/magic

</IfModule>


#

# HostnameLookups: Log the names of clients or just their IP addresses

# e.g., www.apache.org (on) or 204.62.129.132 (off).

# The default is off because it'd be overall better for the net if people

# had to knowingly turn this feature on, since enabling it means that

# each client request will result in AT LEAST one lookup request to the

# nameserver.

#


# 아파치 로그 파일에는 기본적으로 클라이언트의 IP주소가 기록되는데

# On 으로 설정하면 호스트 네임(도메인) 이 기록된다. 도메인으로 기록되면 DNS 로 질의를

# 하는 과정이 추가되기 때문에 속도가 느려지므로 보통 그냥 Off로 둔다.

HostnameLookups Off


# 커널에서 메모리매핑(mmap)을 지원한다면 아파치가 웹문서를 로딩하기 위하여

# 내부문서를 읽을때에 파일을 메모리 매핑하여 처리한다. 따라서 아파치의 성능이 크게 향상될수 있다.

# 그러나 메모리대응이 서버의 성능을 떨어트리고 심지어 안정성을 해치는 경우가 있고

# smp Solaris 서버에서 아파치 2.0은 종종 mmap을 사용하지 않을때가 더 빠르다.

# 또한 NFS 마운트한 파일시스템에 있는 파일을 메모리 대응하는 도중에 다른 NFS 클라이언트에

# 있는 프로세스가 파일을 지우거나 파일크기를 줄이면, 웹서버 프로세스가 다음 번에 메모리대응한

# 파일내용을 읽을때 bus error가 발생할 수 있다.

# 위의 조건에 해당하면 전송하는 파일을 메모리대응하지 않도록 EnableMMAP off를 사용해야 한다.

#EnableMMAP off


# 아파치는 운영체제가 sendfile을 지원하면 커널 sendfile을 사용하여 정적 파일을

# 서비스하는 경우 전송할 파일을 직접 읽지않을 수 있다.

# sendfile을 사용하면 read와 send를 따로 할 필요가 없어서 매우 빨라진다.

# 그러나 sendfile을 사용하면 웹서버의 안정성을 해치게되는 경우가 있고, 커널은 자신의 캐쉬를

# 사용하여 NFS로 마운트한 파일을 안정적으로 서비스할 수 없는 경우가 있으므로

# EnableSendfile off를 사용해서 파일을 sendfile 전송하지 않도록 할수 있다.

#EnableSendfile off



# 에러로그를 기록할 파일의 위치.

# VirtualHost 에서 따로 설정하지 않으면 이곳에 기록된다.

ErrorLog logs/error_log



# 로그메세지를 기록하는 수준을 지정한다.

# 중요도 순서 및 옵션 : debug -> info -> notice -> warn -> error -> crit -> alert -> emerg

LogLevel warn


# 로그의 형식을 정의한다.

# 웹서버 관리자는 자신이 이용하기에 적당하도록 이것을 특히 유심히 설정해야 한다.

# 맨끝에 combined, common, referer, agent 는 그냥 레이블이다

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

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

LogFormat "%{Referer}i -> %U" referer

LogFormat "%{User-agent}i" agent


# "combinedio" includes actual counts of actual bytes received (%I) and sent (%O); this

# requires the mod_logio module to be loaded.

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


# <VirtualHost> 에서 따로 CustomLog를 지정하지 않으면 여기서 지정한 위치에 로그를 남긴다.

#CustomLog logs/access_log common


# 위에 LogFormat 에서 지정한 형식을 사용하는 부분이다.

# 사용할 로그를 주석해제 하면 된다.

#CustomLog logs/referer_log referer

#CustomLog logs/agent_log agent

CustomLog logs/access_log combined



# 에러페이지, FTP 디렉토리 목록, mod_status, mod_info 등에 아파치 버전과

# 가상 호스트 네임을 추가적으로 표시해 준다.

# Email 설정시 ServerAdmin의 이메일주소를 페이지에 링크해 준다.

ServerSignature On


# 디렉토리에 별칭을 주어 접근가능하게 한다.

# 맨앞의 / 는 DocumentRoot 이다

Alias /icons/ "/var/www/icons/"


# Alias 와 기능은 같고 실행할 스크립트 디렉토리에 alias할때 사용한다.

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



# old-URL을 new-URL로 코딩해준다.  하지만 HTML태그로 대신할 수 있기 때문에 사용할 일이 거의 없다.

# Redirect permanent /foo http://www.example.com/bar



# 디렉토리에 DirectoryIndex에 설정된 파일명이 없을경우 아파치서버는 디렉토리목록을 보여주는데 Fancy Indexing을 설정

# 할 경우 파일의 크기, 생성날짜 등을 같이 출력해준다.

IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable


# 디렉토리 목록을 보여준때 확장자별 아이콘들을 세팅한다.

# 별 필요없을듯 해서 자세한 설명은 생략한다.


AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip


AddIconByType (TXT,/icons/text.gif) text/*

AddIconByType (IMG,/icons/image2.gif) image/*

AddIconByType (SND,/icons/sound2.gif) audio/*

AddIconByType (VID,/icons/movie.gif) video/*


AddIcon /icons/binary.gif .bin .exe

AddIcon /icons/binhex.gif .hqx

AddIcon /icons/tar.gif .tar

AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv

AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip

AddIcon /icons/a.gif .ps .ai .eps

AddIcon /icons/layout.gif .html .shtml .htm .pdf

AddIcon /icons/text.gif .txt

AddIcon /icons/c.gif .c

AddIcon /icons/p.gif .pl .py

AddIcon /icons/f.gif .for

AddIcon /icons/dvi.gif .dvi

AddIcon /icons/uuencoded.gif .uu

AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl

AddIcon /icons/tex.gif .tex

AddIcon /icons/bomb.gif core


AddIcon /icons/back.gif ..

AddIcon /icons/hand.right.gif README

AddIcon /icons/folder.gif ^^DIRECTORY^^

AddIcon /icons/blank.gif ^^BLANKICON^^


# 아이콘이 설정되어 있지 않은 파일 확장자들의 아이콘을 대신한다

DefaultIcon /icons/unknown.gif


# 디렉토리 목록을 보여줄 경우 확장자에 대해 간략한 설명을 달 수 있다.

#AddDescription "GZIP compressed document" .gz

#AddDescription "tar archive" .tar

#AddDescription "GZIP compressed tar archive" .tgz


# 디렉토리를 보여줄 경우에 위(HEADER), 아래(README) 에 추가로 출력할 텍스트 파일 지정

ReadmeName README.html

HeaderName HEADER.html


# 디렉토리를 보여줄 경우 파일이 보이지 않게 설정하는 부분

IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t



# 다국어로 웹페이지를 만들었을 경우 클라이언트에 특별한 언어정보가 없으면

# DefaultLanguage 언어로 만들어진 웹페이지가 출력된다.

# 같은 디렉토리에 index.php.ko, index.php.it 이렇게 되어있으면

# 한국에서는 index.php.ko이 이태리에서는 index.php.it 가 실행된다.

# Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl)

# English (en) - Esperanto (eo) - Estonian (et) - French (fr) - German (de)

# Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja)

# Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn)

# Norwegian (no) - Polish (pl) - Portugese (pt)

# Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv)

# Simplified Chinese (zh-CN) - Spanish (es) - Traditional Chinese (zh-TW)


# DefaultLanguage nl


AddLanguage ca .ca

AddLanguage cs .cz .cs

AddLanguage da .dk

AddLanguage de .de

AddLanguage el .el

AddLanguage en .en

AddLanguage eo .eo

AddLanguage es .es

AddLanguage et .et

AddLanguage fr .fr

AddLanguage he .he

AddLanguage hr .hr

AddLanguage it .it

AddLanguage ja .ja

AddLanguage ko .ko

AddLanguage ltz .ltz

AddLanguage nl .nl

AddLanguage nn .nn

AddLanguage no .no

AddLanguage pl .po

AddLanguage pt .pt

AddLanguage pt-BR .pt-br

AddLanguage ru .ru

AddLanguage sv .sv

AddLanguage zh-CN .zh-cn

AddLanguage zh-TW .zh-tw


# 언어의 우선순위 분석중 순위가 같으면 처리할 우선순위를 지정한다

LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW


#

# ForceLanguagePriority allows you to serve a result page rather than

# MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback)

# [in case no accepted languages matched the available variants]

#

ForceLanguagePriority Prefer Fallback


# ※ 아파치의 내용협상

# 클라이언트가 요청을 보낼때 브라우저는 아래와 같은 정보를 서버에게 보낸다.

#

# Accept-Language: fr; q=1.0, en; q=0.5

# Accept: text/html; q=1.0, text/*; q=0.8, image/gif; q=0.6, image/jpeg; q=0.6, image/*; q=0.5, */*; q=0

#

# 프랑스어와 영어를 받을 수 있지만 프랑스어를 더 선호한다

# 여러 mime type 을 받을 수 있지만 텍스트보다는 HTML, 다른 type 보다는 GIF 와 JPEG 를 더 선호한다.



# 기본 캐릭터셋 지정

AddDefaultCharset UTF-8


# 확장자를 mime type 에 연결시킨다.

# MultiViews 기능에 의해 중간에 확장자가 들어간것도 연결되므로

# 파일 업로드를 만들때 이점을 주의해서 만들어야 한다.

#AddType application/x-tar .tgz


# 일부 브라우저에서 전송을 받으면서 정보를 압축해제할 수 있도록 허용할 때 사용하는것으로

# 모든 브라우저에서 이 기능을 지원하지는 않는다.

#AddEncoding x-compress .Z

#AddEncoding x-gzip .gz .tgz


AddType application/x-compress .Z

AddType application/x-gzip .gz .tgz


# 확장자에 대한 액션을 지정한다.

# 형식 : AddHandler 액션Alias명 확장자

#AddHandler cgi-script .cgi


#

# For files that include their own HTTP headers:

# 아파치의 send-asis HTTP 파일 기능 사용(무슨말인지 잘 모르것다)

#AddHandler send-as-is asis


#

# For type maps (negotiated resources):

# (This is enabled by default to allow the Apache "It Worked" page

#  to be distributed in multiple languages.)

# Type map을 사용 (무슨말인지 잘 모르것다)

AddHandler type-map var


#

# Filters allow you to process content before it is sent to the client.

#

# To parse .shtml files for server-side includes (SSI):

# (You will also need to add "Includes" to the "Options" directive.)

#

AddType text/html .shtml

AddOutputFilter INCLUDES .shtml


# 액션지정하는 방법을 설명

# Action lets you define media types that will execute a script whenever

# a matching file is called. This eliminates the need for repeated URL

# pathnames for oft-used CGI file processors.

# Format: Action media/type /cgi-script/location

# Format: Action handler-name /cgi-script/location

#


# 아파치 에러에 대해 보여줄 텍스트나 문서지정

# 문자열은 "" 으로 문서는 경로로 지정한다.

# 외부 url로도 가능하다

#ErrorDocument 500 "The server made a boo boo."

#ErrorDocument 404 /missing.html

#ErrorDocument 404 "/cgi-bin/missing_handler.pl"

#ErrorDocument 402 http://www.example.com/subscription_info.html

#


Alias /error/ "/var/www/error/"


<IfModule mod_negotiation.c>

<IfModule mod_include.c>

<Directory "/var/www/error">

AllowOverride None

Options IncludesNoExec

AddOutputFilter Includes html

AddHandler type-map var

Order allow,deny

Allow from all

LanguagePriority en es de fr

ForceLanguagePriority Prefer Fallback

</Directory>


#    ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var

#    ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var

#    ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var

#    ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var

#    ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var

#    ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var

#    ErrorDocument 410 /error/HTTP_GONE.html.var

#    ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var

#    ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var

#    ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var

#    ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var

#    ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var

#    ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var

#    ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var

#    ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var

#    ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var

#    ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var


</IfModule>

</IfModule>


# ----------------------------------------------------------------------------

# 브라우저들마다 조금씩 다르게 동작하거나 에러가 나는 것들을 방지하기 위해

# 응답을 보낼때 각각의 브라우저들에게 맞게 세팅하는 부분이다

# ----------------------------------------------------------------------------

# 브라우저에 따른 환경세팅

# downgrade-1.0 : 요청이 이후 버전을 사용하더라도 HTTP/1.0 요청으로 처리한다.

# force-gzip : DEFLATE 필터를 사용할때 브라우저의 accept-enconding 설정을 무시하고

#              무조건 압축된 결과를 보낸다

# force-no-vary : 어떤 클라이언트는 Vari필드를 해석하지 못하기 때문에 응답을 보내기전에

#              헤더에서 Vary필드를 뺀다.

# force-response-1.0 : HTTP/1.0 요청을 하는 클라이언트에게 무조건 1.0으로만 보낸다

#              1.1로 보내면 동작하지 않을 수도 있으므로

# gzip-only-text/html : 값이 1이면 text/html이 아닌 content-type에 대해 mod_deflate의

#              DEFLATE 출력필터를 사용하지 않는다.

# no-gzipe : mod_deflate 의 DEFLATE 필터를 사용하지 않고 mod_negotiation은 인코딩된 자원을 보내지 않는다.

# nokeepalive : 위에서 설정한 keepalive 를 무시한다.

# prefer-language : 내용협상시 변수가 en,ko,ja 등의 언어태그를 담고 있으면 mod_negotiation은

               그 언어로 된것을 보낸다. 없으면 일반적인 협상과정을 시작한다.

# redirect-carefully : Microsoft의 WebFolders 소프트웨어가 리다이렉션을 처리하는데 문제가 있어서 만들어졌다.

# suppress-error_charset : 뭔 말인지 이해가 안된다. ㅜㅜ


BrowserMatch "Mozilla/2" nokeepalive

BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0

BrowserMatch "RealPlayer 4\.0" force-response-1.0

BrowserMatch "Java/1\.0" force-response-1.0

BrowserMatch "JDK/1\.0" force-response-1.0


#

# The following directive disables redirects on non-GET requests for

# a directory that does not include the trailing slash.  This fixes a

# problem with Microsoft WebFolders which does not appropriately handle

# redirects for folders with DAV methods.

# Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.

#

BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully

BrowserMatch "MS FrontPage" redirect-carefully

BrowserMatch "^WebDrive" redirect-carefully

BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully

BrowserMatch "^gnome-vfs/1.0" redirect-carefully

BrowserMatch "^XML Spy" redirect-carefully

BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully


#

# Allow server status reports generated by mod_status,

# with the URL of http://servername/server-status

# Change the ".example.com" to match your domain to enable.

# <Location /> 태그는 특정 웹공간의 설정을 바꿀 수 있다

# 아래의 설정은 서버모니터링기능을 설정하는데

# example.com 에서 /server-status 의 설정(모니터링 권한)을 정의하는 내용이다

#<Location /server-status>

#    SetHandler server-status

#    Order deny,allow

#    Deny from all

#    Allow from .example.com

#</Location>


# 서버정보를 볼 수 있도록 설정

#<Location /server-info>

#    SetHandler server-info

#    Order deny,allow

#    Deny from all

#    Allow from .example.com

#</Location>


#

# Proxy Server directives. Uncomment the following lines to

# enable the proxy server:

#

#<IfModule mod_proxy.c>

#ProxyRequests On

#

#<Proxy *>

#    Order deny,allow

#    Deny from all

#    Allow from .example.com

#</Proxy>


#

# Enable/disable the handling of HTTP/1.1 "Via:" headers.

# ("Full" adds the server version; "Block" removes all outgoing Via: headers)

# Set to one of: Off | On | Full | Block

#

#ProxyVia On


#

# To enable a cache of proxied content, uncomment the following lines.

# See http://httpd.apache.org/docs/2.2/mod/mod_cache.html for more details.

#

#<IfModule mod_disk_cache.c>

#   CacheEnable disk /

#   CacheRoot "/var/cache/mod_proxy"

#</IfModule>

#


#</IfModule>

# End of proxy directives.





#***************************************************************************

#    Section 3: Virtual Hosts (가상 호스트에 대한 설정)

#***************************************************************************

#

# VirtualHost: If you want to maintain multiple domains/hostnames on your

# machine you can setup VirtualHost containers for them. Most configurations

# use only name-based virtual hosts so the server doesn't need to worry about

# IP addresses. This is indicated by the asterisks in the directives below.

#

# Please see the documentation at

# <URL:http://httpd.apache.org/docs/2.2/vhosts/>

# for further details before you try to setup virtual hosts.

#

# You may use the command line option '-S' to verify your virtual host

# configuration.


#

# Use name-based virtual hosting.

#

#NameVirtualHost *:80

#

# NOTE: NameVirtualHost cannot be used without a port specifier

# (e.g. :80) if mod_ssl is being used, due to the nature of the

# SSL protocol.

#


#

# VirtualHost example:

# Almost any Apache directive may go into a VirtualHost container.

# The first VirtualHost section is used for requests without a known

# server name.

#

#<VirtualHost *:80>

#    ServerAdmin webmaster@dummy-host.example.com

#    DocumentRoot /www/docs/dummy-host.example.com

#    ServerName dummy-host.example.com

#    ErrorLog logs/dummy-host.example.com-error_log

#    CustomLog logs/dummy-host.example.com-access_log common

#</VirtualHost>


#<VirtualHost _default_:80>

#ServerAdmin i@abcd.net

#ServerAlias www2.abcd.net

#DocumentRoot /home/abcd/public_html

#ErrorLog logs/abcd.net-error_log

#CustomLog logs/abcd.net-access_log common

#</VirtualHost>


#ads_1

이 글은 스프링노트에서 작성되었습니다.


Comments