sections.html.ko.euc-kr 25.1 KB
Newer Older
powelld's avatar
powelld committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452
<?xml version="1.0" encoding="EUC-KR"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ko" xml:lang="ko"><head>
<meta content="text/html; charset=EUC-KR" http-equiv="Content-Type" />
<!--
        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
              This file is generated from xml source: DO NOT EDIT
        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      -->
<title>섹션 설정 - Apache HTTP Server Version 2.4</title>
<link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
<link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
<link href="./style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="./style/css/prettify.css" />
<script src="./style/scripts/prettify.min.js" type="text/javascript">
</script>

<link href="./images/favicon.ico" rel="shortcut icon" /></head>
<body id="manual-page"><div id="page-header">
<p class="menu"><a href="./mod/">모듈</a> | <a href="./mod/directives.html">지시어들</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">용어</a> | <a href="./sitemap.html">사이트맵</a></p>
<p class="apache">Apache HTTP Server Version 2.4</p>
<img alt="" src="./images/feather.png" /></div>
<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="./images/left.gif" /></a></div>
<div id="path">
<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="./">Version 2.4</a></div><div id="page-content"><div id="preamble"><h1>섹션 설정</h1>
<div class="toplang">
<p><span>가능한 언어: </span><a href="./en/sections.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
<a href="./fr/sections.html" hreflang="fr" rel="alternate" title="Fran&#231;ais">&nbsp;fr&nbsp;</a> |
<a href="./ja/sections.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
<a href="./ko/sections.html" title="Korean">&nbsp;ko&nbsp;</a> |
<a href="./tr/sections.html" hreflang="tr" rel="alternate" title="T&#252;rk&#231;e">&nbsp;tr&nbsp;</a></p>
</div>
<div class="outofdate">이 문서는 최신판 번역이 아닙니다.
            최근에 변경된 내용은 영어 문서를 참고하세요.</div>
 <p><a href="configuring.html">설정파일</a>에 있는
지시어는 서버 전체에 적용되거나, 특정 디렉토리, 파일, 호스트,
URL에만 적용될 수 있다. 이 문서는 다른 지시어의 적용범위를
제한하기위해 설정 섹션이나 <code>.htaccess</code> 파일을
사용하는 방법을 설명한다.</p>
</div>
<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><ul id="toc"><li><img alt="" src="./images/down.gif" /> <a href="#types">설정 섹션의 종류</a></li>
<li><img alt="" src="./images/down.gif" /> <a href="#file-and-web">파일시스템과 웹공간</a></li>
<li><img alt="" src="./images/down.gif" /> <a href="#virtualhost">가상호스트</a></li>
<li><img alt="" src="./images/down.gif" /> <a href="#proxy">프록시</a></li>
<li><img alt="" src="./images/down.gif" /> <a href="#whatwhere">안에 어떤 지시어를 사용할 수
있나?</a></li>
<li><img alt="" src="./images/down.gif" /> <a href="#mergin">섹션들이 결합하는 방법</a></li>
</ul><h3>참고</h3><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
<div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
<div class="section">
<h2><a name="types" id="types">설정 섹션의 종류</a></h2>

<table class="related"><tr><th>관련된 모듈</th><th>관련된 지시어</th></tr><tr><td><ul><li><code class="module"><a href="./mod/core.html">core</a></code></li><li><code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code></li></ul></td><td><ul><li><code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#directorymatch">&lt;DirectoryMatch&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#filesmatch">&lt;FilesMatch&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#ifdefine">&lt;IfDefine&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#ifmodule">&lt;IfModule&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#locationmatch">&lt;LocationMatch&gt;</a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxy">&lt;Proxy&gt;</a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxymatch">&lt;ProxyMatch&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code></li></ul></td></tr></table>

<p>섹션에는 두가지 종류가 있다. 대부분은 매요청마다 처리된다.
해당하는 요청에만 안에 포함한 지시어를 적용한다. 반대로, <code class="directive"><a href="./mod/core.html#ifdefine">&lt;IfDefine&gt;</a></code><code class="directive"><a href="./mod/core.html#ifmodule">&lt;IfModule&gt;</a></code>은 서버가
시작할때와 꺼질때만 처리한다. 시작할때 상태가 참이면 안에 있는
지시어가 모든 요청에 적용된다. 참이 아니면 안에 있는 지시어는
무시한다.</p>

<p><code class="directive"><a href="./mod/core.html#ifdefine">&lt;IfDefine&gt;</a></code>
지시어는 <code>httpd</code> 명령행에 적절한 파라미터가 있는
경우에만 안에 포함한 지시어를 적용한다. 다음 설정을 예로 들면,
서버를 <code>httpd -DClosedForNow</code>로 시작할 경우에만
모든 요청이 다른 사이트로 리다이렉션된다:</p>

<div class="example"><p><code>
&lt;IfDefine ClosedForNow&gt;<br />
Redirect / http://otherserver.example.com/<br />
&lt;/IfDefine&gt;
</code></p></div>

<p><code class="directive"><a href="./mod/core.html#ifmodule">&lt;IfModule&gt;</a></code>
지시어도 특정 모듈이 서버에 포함된 경우에만 안에 든 지시어를
적용한다는 점을 제외하고는 매우 비슷하다. 모듈을 서버에 정적으로
컴파일하거나 동적으로 컴파일한후 설정파일 앞에 <code class="directive"><a href="./mod/mod_so.html#loadmodule">LoadModule</a></code> 줄이 있어야 한다. 이
지시어는 특정 모듈의 설치유무에 따라 설정파일이 다를 필요가
있을때만 사용해야 한다. 모듈이 없는 경우 유용한 오류문이 나오지않을
수 있기 때문에 언제나 사용하길 원하는 지시어를 안에 두면 안된다.</p>

<p>다음 예에서 <code class="module"><a href="./mod/mod_mime_magic.html">mod_mime_magic</a></code>이 있을때만 <code class="directive"><a href="./mod/mod_mime_magic.html#mimemagicfiles">MimeMagicFiles</a></code> 지시어를
처리한다.</p>

<div class="example"><p><code>
&lt;IfModule mod_mime_magic.c&gt;<br />
MimeMagicFile conf/magic<br />
&lt;/IfModule&gt;
</code></p></div>

<p><code class="directive"><a href="./mod/core.html#ifdefine">&lt;IfDefine&gt;</a></code>
<code class="directive"><a href="./mod/core.html#ifmodule">&lt;IfModule&gt;</a></code>
검사 앞에 "!"을 붙여 조건을 역으로 할 수 있다. 또, 여러 섹션들을
겹쳐서 사용하여 더 복잡한 효과를 얻을 수 있다.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
<div class="section">
<h2><a name="file-and-web" id="file-and-web">파일시스템과 웹공간</a></h2>

<p>가장 자주 사용되는 설정 섹션은 파일시스템과 웹공간(webspace)의
특정 장소에 대한 설정을 변경하는 것들이다. 먼저 이 둘의 차이를
이해하는 것이 중요하다. 파일시스템은 운영체제 입장에서 디스크를
보는 관점이다. 예를 들어, 기본값으로 아파치를 설치를 하면 유닉스
파일시스템의 경우 <code>/usr/local/apache2</code>, 윈도우즈
파일시스템의 경우 <code>"c:/Program Files/Apache
Group/Apache2"</code>에 설치된다. (아파치는 윈도우즈에서 조차
항상, 역슬래쉬가 아닌, 슬래쉬를 사용함을 주의하라.) 반대로
웹공간은 웹서버가 제공하고 클라이언트가 보게될 사이트의 관점이다.
그래서 유닉스에서 기본 아파치 설치를 한 경우 웹경로의 경로
<code>/dir/</code>은 파일시스템 경로
<code>/usr/local/apache2/htdocs/dir/</code>에 해당한다. 웹공간은
데이타베이스 등에서 동적으로 생성될 수 있기때문에 반드시
파일시스템에 직접 대응될 필요는 없다.</p>

<h3><a name="filesystem" id="filesystem">파일시스템 섹션</a></h3>

<p><code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code>
<code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code> 지시어와
정규표현식을 사용하는 지시어는 파일시스템의 특정 부분에 지시어를
적용한다. <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> 지시어에 포함된 지시어들은
지정한 파일시스템 디렉토리와 그 하위 디렉토리에 적용된다. <a href="howto/htaccess.html">.htaccess 파일</a>을 사용해도 결과는
같다. 다음 설정을 예로 들면, 디렉토리 목록(index)이
<code>/var/web/dir1</code> 이하 디렉토리에서 디렉토리 목록(index)이
가능하다.</p>

<div class="example"><p><code>
&lt;Directory /var/web/dir1&gt;<br />
Options +Indexes<br />
&lt;/Directory&gt;
</code></p></div>

<p><code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code> 섹션에 포함된 지시어들은 어떤
디렉토리에 있는지 관계없이 지정한 이름을 가진 파일에 적용된다.
설정파일의 주설정부분에 있는 다음 설정을 예로 들면, 장소와
관계없이 <code>private.html</code>이란 이름을 한 파일의 접근을
거부한다.</p>

<div class="example"><p><code>
&lt;Files private.html&gt;<br />
Order allow,deny<br />
Deny from all<br />
&lt;/Files&gt;
</code></p></div>

<p>파일시스템의 특정 부분에 있는 파일을 지칭하기위해 <code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code><code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> 섹션을 같이
사용한다. 다음 설정을 예로 들면,
<code>/var/web/dir1/private.html</code>,
<code>/var/web/dir1/subdir2/private.html</code>,
<code>/var/web/dir1/subdir3/private.html</code> 같이
<code>/var/web/dir1/</code> 디렉토리 아래에 있는 이름이
<code>private.html</code>인 파일의 접근을 거부한다.</p>

<div class="example"><p><code>
&lt;Directory /var/web/dir1&gt;<br />
&lt;Files private.html&gt;<br />
Order allow,deny<br />
Deny from all<br />
&lt;/Files&gt;<br />
&lt;/Directory&gt;
</code></p></div>


<h3><a name="webspace" id="webspace">웹공간 섹션</a></h3>

<p><code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code>
지시어와 이에 해당하는 정규표현식을 사용하는 지시어는 반대로
특정 웹공간의 설정을 바꾼다. 다음 설정을 예로 들면, /private으로
시작하는 URL-경로의 접근이 거부된다. 여기에는
<code>http://yoursite.example.com/private</code>,
<code>http://yoursite.example.com/private123</code>,
<code>http://yoursite.example.com/private/dir/file.html</code>
같이 <code>/private</code> 문자열로 시작하는 요청이 해당된다.</p>

<div class="example"><p><code>
&lt;Location /private&gt;<br />
Order Allow,Deny<br />
Deny from all<br />
&lt;/Location&gt;
</code></p></div>

<p><code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code>
지시어는 파일시스템에 대응할 필요가 없다. 다음 예는 어떻게 특정
URL을 <code class="module"><a href="./mod/mod_status.html">mod_status</a></code>가 제공하는 아파치 내부 핸들러로
대응시키는지를 보여준다. 파일시스템에 <code>server-status</code>라는
파일은 필요없다.</p>

<div class="example"><p><code>
&lt;Location /server-status&gt;<br />
SetHandler server-status<br />
&lt;/Location&gt;
</code></p></div>


<h3><a name="wildcards" id="wildcards">와일드카드와 정규표현식</a></h3>

<p><code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code>,
<code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code>,
<code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code>
지시어에서 C 표준 파이브러리의 <code>fnmatch</code>와 같은
쉘에서 사용하는 와일드카드 문자를 사용할 수 있다.
"*" 문자는 어떤 문자열이라도 나타내고, "?" 문자는 어떤 문자 한개를
나타내며, "[<em>seq</em>]"는 <em>seq</em> 중에 한 문자를 나타낸다.
어떤 와일드카드도 "/" 문자를 나타내지는 못한다. 그래서 이 문자는
직접 사용해야 한다.</p>

<p>더 유연한 설정이 필요하면 perl호환 <a href="glossary.html#regex">정규표현식</a>을 사용하는 <code class="directive"><a href="./mod/core.html#directorymatch">&lt;DirectoryMatch&gt;</a></code>, <code class="directive"><a href="./mod/core.html#filesmatch">&lt;FilesMatch&gt;</a></code>, <code class="directive"><a href="./mod/core.html#locationmatch">&lt;LocationMatch&gt;</a></code>를 사용할
수 있다. 그러나 아래 설정의 결합에 관한 절에서 정규표현식 섹션을
사용하면 지시어가 적용되는 방법이 어떻게 변하는지 살펴봐라.</p>

<p>모든 사용자 디렉토리 설정을 변경하는 비정규표현식 와일드카드
섹션은 다음과 같다:</p>

<div class="example"><p><code>
&lt;Directory /home/*/public_html&gt;<br />
Options Indexes<br />
&lt;/Directory&gt;
</code></p></div>

<p>정규표현식 섹션을 사용하여 한번에 여러 종류의 그림파일에
대한 접근을 거부할 수 있다:</p>
<div class="example"><p><code>
&lt;FilesMatch \.(?i:gif|jpe?g|png)$&gt;<br />
Order allow,deny<br />
Deny from all<br />
&lt;/FilesMatch&gt;
</code></p></div>



<h3><a name="whichwhen" id="whichwhen">무엇을 사용하나</a></h3>

<p>파일시스템 섹션과 웹공간 섹션 중 하나를 선택하는 것은 실제로
매우 쉽다. 파일시스템에 있는 객체에 지시어를 적용할때는 항상
<code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code>
<code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code>
사용한다. (데이타베이스에서 생성한 웹페이지와 같이) 파일시스템에
있지 않는 객체에 지시어를 적용할때는 <code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code>을 사용한다.</p>

<p>파일시스템에 있는 객체의 접근을 제한하기위해 <code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code>을 사용하면
절대 안된다. 여러 다른 웹공간 장소(URL)가 같은 파일시스템 장소에
대응될 수 있으므로, 걸어둔 제한을 우회할 수 있기 때문이다. 다음
설정의 예를 살펴보자:</p>

<div class="example"><p><code>
&lt;Location /dir/&gt;<br />
Order allow,deny<br />
Deny from all<br />
&lt;/Location&gt;
</code></p></div>

<p>이 설정은 <code>http://yoursite.example.com/dir/</code>
요청한다면 잘 작동한다. 그러나 대소문자를 구별하지않는 파일시스템을
사용한다면 어떻게되나?
<code>http://yoursite.example.com/DIR/</code>을 요청하여 쉽게
제한을 우회할 수 있다. 반대로 <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> 지시어는 어떻게 요청하였는지
관계없이 그 장소에서 서비스되는 내용에 적용된다. (예외는 파일시스템
링크를 사용하는 경우다. 심볼링크를 사용하여 한 디렉토리를
파일시스템의 여러 장소에 둘 수 있다. <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> 지시어는 심볼링크를 따라간다.
그러므로 높은 수준의 보안을 위해서는 적절한 <code class="directive"><a href="./mod/core.html#options">Options</a></code> 지시어를 사용하여 심볼링크를
무시해야 한다.)</p>

<p>아마도 당신은 대소문자를 구별하는 파일시스템을 사용하므로
이런 일이 일어나지 않는다고 생각할지도 모른다. 그러나 다른
방법으로도 여러 웹공간 위치가 한 파일시스템 위치에 대응될 수
있음을 기억하라. 그래서 가능하면 항상 파일시스템 섹션을 사용해야
한다. 그러나 이 규칙에 예외가 하나 있다. 설정 제한을
<code>&lt;Location /&gt;</code> 섹션에 두면 이 섹션이 특정
URL이 아닌 모든 요청에 적용되므로 완벽하게 안전하다.</p>


</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
<div class="section">
<h2><a name="virtualhost" id="virtualhost">가상호스트</a></h2>

<p><code class="directive"><a href="./mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code>
섹션은 특정 호스트에 적용되는 지시어들을 포함한다. 이는 한
컴퓨터에서 각각 다른 설정을 사용한 여러 호스트를 서비스할때
유용하다. 더 자세한 정보는 <a href="vhosts/">가상호스트 문서</a>
참고하라.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
<div class="section">
<h2><a name="proxy" id="proxy">프록시</a></h2>

<p><code class="directive"><a href="./mod/mod_proxy.html#proxy">&lt;Proxy&gt;</a></code>
<code class="directive"><a href="./mod/mod_proxy.html#proxymatch">&lt;ProxyMatch&gt;</a></code>
섹션은 지정한 URL에 대해 <code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code> 프록시 서버를
거쳐 접근하는 경우에만 적용된다. 다음 설정을 예로 들면, 프록시
서버를 통해 <code>cnn.com</code> 웹사이트에 접근할 수 없다.</p>

<div class="example"><p><code>
&lt;Proxy http://cnn.com/*&gt;<br />
Order allow,deny<br />
Deny from all<br />
&lt;/Proxy&gt;
</code></p></div>
</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
<div class="section">
<h2><a name="whatwhere" id="whatwhere">안에 어떤 지시어를 사용할 수
있나?</a></h2>

<p>어떤 설정 섹션안에 사용할 수 있는 지시어를 알려면 지시어의
<a href="mod/directive-dict.html#Context">사용장소</a>를 확인하라.
<code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code>에서
사용가능한 지시어는 <code class="directive"><a href="./mod/core.html#directorymatch">&lt;DirectoryMatch&gt;</a></code>, <code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code>, <code class="directive"><a href="./mod/core.html#filesmatch">&lt;FilesMatch&gt;</a></code>, <code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code>, <code class="directive"><a href="./mod/core.html#locationmatch">&lt;LocationMatch&gt;</a></code>, <code class="directive"><a href="./mod/mod_proxy.html#proxy">&lt;Proxy&gt;</a></code>, <code class="directive"><a href="./mod/mod_proxy.html#proxymatch">&lt;ProxyMatch&gt;</a></code> 섹션에서도 사용가능하다.
그러나, 예외가 있다:</p>

<ul>
<li><code class="directive"><a href="./mod/core.html#allowoverride">AllowOverride</a></code> 지시어는
<code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code>
섹션에서만 사용할 수 있다.</li>

<li><code>FollowSymLinks</code>, <code>SymLinksIfOwnerMatch</code>,
<code class="directive"><a href="./mod/core.html#options">Options</a></code><code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> 섹션이나
<code>.htaccess</code> 파일에서만 사용할 수 있다.</li>

<li><code class="directive"><a href="./mod/core.html#options">Options</a></code> 지시어는
<code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code>
<code class="directive"><a href="./mod/core.html#filesmatch">&lt;FilesMatch&gt;</a></code>
섹션에서 사용할 수 없다.</li>
</ul>
</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
<div class="section">
<h2><a name="mergin" id="mergin">섹션들이 결합하는 방법</a></h2>

<p>설정 섹션은 매우 특별한 방법으로 적용된다. 이 순서가 설정
지시어를 해석하는 방법에 중요한 영향을 주기때문에 이 방법을
이해하는 것이 중요하다.</p>

    <p>결합하는 순서는:</p>

    <ol>
      <li> (정규표현식을 사용하지않는) <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code><code>.htaccess</code>
      동시에 일어난다 (경우에 따라 <code>.htaccess</code>
      <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code>
      무시하도록 설정할 수 있다)</li>

      <li><code class="directive"><a href="./mod/core.html#directorymatch">&lt;DirectoryMatch&gt;</a></code> (그리고
      <code>&lt;Directory ~&gt;</code>)</li>

      <li><code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code><code class="directive"><a href="./mod/core.html#filesmatch">&lt;FilesMatch&gt;</a></code>는 동시에 일어난다</li>

      <li><code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code><code class="directive"><a href="./mod/core.html#locationmatch">&lt;LocationMatch&gt;</a></code>는 동시에 일어난다</li>
    </ol>

    <p><code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code>를 제외하고 각 섹션들을
    설정파일에 나온 순서대로 처리된다. (위의 순서 1) <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code>는 디렉토리
    내용이 가장 짧은 것에서 긴쪽으로 처리된다. 그래서 예를 들어,
    <code>&lt;Directory /var/web/dir&gt;</code>
    <code>&lt;Directory /var/web/dir/subdir&gt;</code> 이전에
    처리한다. 같은 디렉토리를 지칭하는 여러 <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> 섹션이
    있다면 이들을 설정파일 순서대로 처리한다. <code class="directive"><a href="./mod/core.html#include">Include</a></code> 지시어로 포함한 설정은
    <code class="directive"><a href="./mod/core.html#include">Include</a></code> 지시어 위치에
    포함한 파일 내용이 있는 것처럼 처리한다.</p>

    <p><code class="directive"><a href="./mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> 섹션 안에 포함된 섹션은
    가상호스트 정의 밖에 있는 해당 섹션 <em>이후에</em> 적용된다.
    그래서 가상호스트 안에서 주서버의 설정사항을 수정할 수 있다.</p>

    <p><code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code>가 요청 서비스할때, <code class="directive"><a href="./mod/mod_proxy.html#proxy">&lt;Proxy&gt;</a></code> 섹션의
    처리순서는 <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> 섹션과 같다.</p>

    <p>다음에 나오는 섹션은 이전 섹션의 결과를 수정한다.</p>

<div class="note"><h3>기술적 주의</h3>
      실제로
      <code>&lt;Location&gt;</code>/<code>&lt;LocationMatch&gt;</code>
      (<code>Aliases</code><code>DocumentRoot</code>를 사용하여
      URL을 파일명으로 변환하는) 이름번역 단계 이전에 처리된다.
      변역이 끝난 이후에는 완전히 무시한다.
</div>

<h3><a name="merge-examples" id="merge-examples">예제</a></h3>

<p>다음은 겹합하는 순서를 설명하는 예다. 이들 모두 요청에
적용된다고 가정하면 지시어는 A &gt; B &gt; C &gt; D &gt; E
순서로 처리된다.</p>

<div class="example"><p><code>
&lt;Location /&gt;<br />
E<br />
&lt;/Location&gt;<br />
<br />
&lt;Files f.html&gt;<br />
D<br />
&lt;/Files&gt;<br />
<br />
&lt;VirtualHost *&gt;<br />
&lt;Directory /a/b&gt;<br />
B<br />
&lt;/Directory&gt;<br />
&lt;/VirtualHost&gt;<br />
<br />
&lt;DirectoryMatch "^.*b$"&gt;<br />
C<br />
&lt;/DirectoryMatch&gt;<br />
<br />
&lt;Directory /a/b&gt;<br />
A<br />
&lt;/Directory&gt;<br />
<br />
</code></p></div>

<p>더 현실적인 예는 다음과 같다. <code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code> 섹션을 나중에 처리하므로
<code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code>
섹션에 있는 접근제한과 관계없이 서버에 무제한 접근을 가능하다.
즉, 결합하는 순서는 중요하므로 주의하라!</p>

<div class="example"><p><code>
&lt;Location /&gt;<br />
Order deny,allow<br />
Allow from all<br />
&lt;/Location&gt;<br />
<br />
# 악!  이 &lt;Directory&gt; 섹션은 아무런 효과가 없다<br />
&lt;Directory /&gt;<br />
Order allow,deny<br />
Allow from all<br />
Deny from badguy.example.com<br />
&lt;/Directory&gt;
</code></p></div>



</div></div>
<div class="bottomlang">
<p><span>가능한 언어: </span><a href="./en/sections.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
<a href="./fr/sections.html" hreflang="fr" rel="alternate" title="Fran&#231;ais">&nbsp;fr&nbsp;</a> |
<a href="./ja/sections.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
<a href="./ko/sections.html" title="Korean">&nbsp;ko&nbsp;</a> |
<a href="./tr/sections.html" hreflang="tr" rel="alternate" title="T&#252;rk&#231;e">&nbsp;tr&nbsp;</a></p>
</div><div class="top"><a href="#page-header"><img src="./images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
<script type="text/javascript"><!--//--><![CDATA[//><!--
var comments_shortname = 'httpd';
var comments_identifier = 'http://httpd.apache.org/docs/2.4/sections.html';
(function(w, d) {
    if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
        d.write('<div id="comments_thread"><\/div>');
        var s = d.createElement('script');
        s.type = 'text/javascript';
        s.async = true;
        s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
        (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
    }
    else { 
        d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
    }
})(window, document);
//--><!]]></script></div><div id="footer">
<p class="apache">Copyright 2017 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
<p class="menu"><a href="./mod/">모듈</a> | <a href="./mod/directives.html">지시어들</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">용어</a> | <a href="./sitemap.html">사이트맵</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
if (typeof(prettyPrint) !== 'undefined') {
    prettyPrint();
}
//--><!]]></script>
</body></html>