mirror of
https://github.com/apache/httpd.git
synced 2025-11-08 04:22:21 +03:00
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103525 13f79535-47bb-0310-9956-ffa450edef68
207 lines
12 KiB
XML
207 lines
12 KiB
XML
<?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><!--
|
|
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
|
This file is generated from xml source: DO NOT EDIT
|
|
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
|
-->
|
|
<title>mod_file_cache - Apache HTTP Server</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 href="../images/favicon.ico" rel="shortcut icon" /></head>
|
|
<body>
|
|
<div id="page-header">
|
|
<p class="menu"><a href="../mod/">모듈</a> | <a href="../mod/directives.html">지시어들</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">용어</a> | <a href="../sitemap.html">사이트맵</a></p>
|
|
<p class="apache">Apache HTTP Server Version 2.1</p>
|
|
<img alt="" src="../images/feather.gif" /></div>
|
|
<div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
|
|
<div id="path">
|
|
<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs-project/">Documentation</a> > <a href="../">Version 2.1</a> > <a href="./">모듈</a></div>
|
|
<div id="page-content">
|
|
<div id="preamble"><h1>아파치 모듈 mod_file_cache</h1>
|
|
<div class="toplang">
|
|
<p><span>가능한 언어: </span><a href="../en/mod/mod_file_cache.html" hreflang="en" rel="alternate" title="English"> en </a> |
|
|
<a href="../ko/mod/mod_file_cache.html" title="Korean"> ko </a></p>
|
|
</div>
|
|
<table class="module"><tr><th><a href="module-dict.html#Description">설명:</a></th><td>메모리에 정적 파일들을 캐쉬</td></tr>
|
|
<tr><th><a href="module-dict.html#Status">상태:</a></th><td>Experimental</td></tr>
|
|
<tr><th><a href="module-dict.html#ModuleIdentifier">모듈명:</a></th><td>file_cache_module</td></tr>
|
|
<tr><th><a href="module-dict.html#SourceFile">소스파일:</a></th><td>mod_file_cache.c</td></tr></table>
|
|
<h3>요약</h3>
|
|
|
|
|
|
<div class="warning">
|
|
이 모듈은 조심해서 사용해야 한다. <code class="module"><a href="../mod/mod_file_cache.html">mod_file_cache</a></code>를
|
|
사용하여 사이트를 망치기 쉬우므로 이 문제를 꼼꼼히 읽어라.
|
|
</div>
|
|
|
|
<p>거의 변하지 않고 자주 요청되는 파일을 <em>캐쉬</em>에 저장하여
|
|
서버 부하를 줄일 수 있다. <code class="module"><a href="../mod/mod_file_cache.html">mod_file_cache</a></code>는
|
|
두가지 방식으로 자주 요청되는 <em>정적</em> 파일을 캐쉬에 저장한다.
|
|
설정 지시어를 통해 <code class="module"><a href="../mod/mod_file_cache.html">mod_file_cache</a></code>가 파일을
|
|
열고(open) <code>mmap()</code>할지 파일을 미리 열고
|
|
<em>파일 핸들러</em>를 저장할지 결정한다. 두 방식 모두
|
|
파일을 서비스하기위한 작업의 일부를 ((특히 파일 입출력) 파일 요청때마다
|
|
하는 대신 서버가 시작할때 하여 서버 부하를 감소한다.</p>
|
|
|
|
<p>주의: 이 방법은 CGI 프로그램이나 특별한 내용핸들러를 통해 서비스하는
|
|
파일의 속도를 향상할 수 없다. 이 방법은 보통 아파치 core 내용핸들러가
|
|
서비스하는 일반파일에만 적용된다.</p>
|
|
|
|
<p>이 모듈은 아파치 1.3의 <code>mod_mmap_static</code> 모듈의
|
|
영향을 많이 받은 확장이다.</p>
|
|
</div>
|
|
<div id="quickview"><h3 class="directives">지시어들</h3>
|
|
<ul id="toc">
|
|
<li><img alt="" src="../images/down.gif" /> <a href="#cachefile">CacheFile</a></li>
|
|
<li><img alt="" src="../images/down.gif" /> <a href="#mmapfile">MMapFile</a></li>
|
|
</ul>
|
|
<h3>주제</h3>
|
|
<ul id="topics">
|
|
<li><img alt="" src="../images/down.gif" /> <a href="#using">mod_file_cache 사용하기</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="using" id="using">mod_file_cache 사용하기</a></h2>
|
|
|
|
<p><code class="module"><a href="../mod/mod_file_cache.html">mod_file_cache</a></code>는 주서버 설정에서
|
|
<code class="directive"><a href="#mmapfile">MMapFile</a></code>과 <code class="directive"><a href="#cachefile">CacheFile</a></code> 지시어를 통해 설정한 정적 파일들을
|
|
캐쉬에 저장한다.</p>
|
|
|
|
<p>모든 플래폼이 두 지시어를 모두 지원하는 것은 아니다.
|
|
예를 들어, 윈도우즈용 아파치는 현재 <code class="directive"><a href="#mmapstatic">MMapStatic</a></code> 지시어를
|
|
지원하지 않지만, AIX 같은 다른 플래폼은 둘 모두 지원한다.
|
|
지원하지않는 지시어를 사용할 경우 서버 오류 로그에 오류문을
|
|
남긴다. 지원하지않는 지시어를 사용해도 서버는 시작하지만
|
|
파일을 캐쉬에 저장하지 않는다. 두 지시어를 모두 지원하는 플래폼을
|
|
사용한다면 어떤 방식이 더 좋은지 실험해볼 수 있다.</p>
|
|
|
|
<h3>MMapFile 지시어</h3>
|
|
|
|
<p><code class="module"><a href="../mod/mod_file_cache.html">mod_file_cache</a></code>의
|
|
<code class="directive"><a href="#mmapfile">MMapFile</a></code> 지시어는
|
|
설정한 정적인 파일들을 <code>mmap()</code> 시스템호출을 사용하여
|
|
메모리에 대응한다. 많은 최근 유닉스류 운영체제에 이 시스템호출이
|
|
있지만, 없는 운영체제도 있다. 또, <code>mmap()</code>할 수 있는
|
|
파일 크기와 개수를 시스템이 제한할 수 있으므로 실험해보는 것이
|
|
좋다.</p>
|
|
|
|
<p>서버가 시작할때와 재시작할때만 <code>mmap()</code>을
|
|
한다. 그래서 파일시스템에서 해당 파일중 하나라도 변경된 경우
|
|
서버를 재시작<em>해야</em> 한다 (<a href="../stopping.html">Stopping and Restarting</a> 문서 참고).
|
|
다시 강조하면: 서버를 재시작하지않고 파일을 수정하면
|
|
요청 서비스가 완전히 이상할 수 있다. 이전 파일을 지우고(unlink)
|
|
새로 파일을 만들어서 파일을 수정해야 한다. <code>rdist</code>나
|
|
<code>mv</code>와 같이 많은 도구가 이런 식으로 동작한다.
|
|
매번 추가로 불필요한 <code>stat()</code> 검사가 필요하고
|
|
입출력 감소의 의도에 반하므로 이 모듈은 파일 변화를 신경쓰지않는다.</p>
|
|
|
|
|
|
<h3>CacheFile 지시어</h3>
|
|
|
|
<p><code class="module"><a href="../mod/mod_file_cache.html">mod_file_cache</a></code>의
|
|
<code class="directive"><a href="#cachefile">CacheFile</a></code> 지시어는
|
|
설정 지시어에 열거한
|
|
파일(과 파일들)의 <em>핸들(handle)</em> 혹은
|
|
<em>파일 기술자(file descriptor)</em>를 열고(open) 캐쉬에 저장한다.
|
|
파일을 요청하면 서버는 캐쉬에서 핸들을 찾아서 소켓 API
|
|
<code>sendfile()</code>에 (윈도우즈에서는 <code>TransmitFile()</code>)
|
|
넘긴다.</p>
|
|
|
|
|
|
|
|
<p>서버가 시작할때와 재시작할때만 이런 파일핸들 캐쉬를
|
|
만든다. ...
|
|
This file handle caching is done once at server start or
|
|
restart, only. So whenever one of the cached files changes on
|
|
the filesystem you <em>have</em> to restart the server (see the
|
|
<a href="../stopping.html">Stopping and Restarting</a>
|
|
documentation). To reiterate that point: if the files are
|
|
modified <em>in place</em> without restarting the server you
|
|
may end up serving requests that are completely bogus. You
|
|
should update files by unlinking the old copy and putting a new
|
|
copy in place. Most tools such as <code>rdist</code> and
|
|
<code>mv</code> do this.</p>
|
|
|
|
|
|
<div class="note"><h3>주의</h3>
|
|
<p>디렉토리의 모든 파일을 재귀적으로 캐쉬에 저장하는
|
|
지시어를 요구하지 마라. 대신 이렇게 해봐라...
|
|
<code class="directive"><a href="../mod/core.html#include">Include</a></code> 지시어를 참고하고
|
|
다음과 같은 명령을 실행하라:</p>
|
|
|
|
<div class="example"><p><code>
|
|
find /www/htdocs -type f -print \<br />
|
|
| sed -e 's/.*/mmapfile &/' > /www/conf/mmap.conf
|
|
</code></p></div>
|
|
</div>
|
|
</div>
|
|
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
|
|
<div class="directive-section"><h2><a name="CacheFile" id="CacheFile">CacheFile</a> <a name="cachefile" id="cachefile">지시어</a></h2>
|
|
<table class="directive">
|
|
<tr><th><a href="directive-dict.html#Description">설명:</a></th><td>Cache a list of file handles at startup time</td></tr>
|
|
<tr><th><a href="directive-dict.html#Syntax">문법:</a></th><td><code>CacheFile <var>file-path</var> [<var>file-path</var>] ...</code></td></tr>
|
|
<tr><th><a href="directive-dict.html#Context">사용장소:</a></th><td>주서버설정</td></tr>
|
|
<tr><th><a href="directive-dict.html#Status">상태:</a></th><td>Experimental</td></tr>
|
|
<tr><th><a href="directive-dict.html#Module">모듈:</a></th><td>mod_file_cache</td></tr>
|
|
</table>
|
|
<p>The <code class="directive">CacheFile</code> directive opens handles to
|
|
one or more files (given as whitespace separated arguments) and
|
|
places these handles into the cache at server startup
|
|
time. Handles to cached files are automatically closed on a server
|
|
shutdown. When the files have changed on the filesystem, the
|
|
server should be restarted to to re-cache them.</p>
|
|
|
|
<p>Be careful with the <var>file-path</var> arguments: They have
|
|
to literally match the filesystem path Apache's URL-to-filename
|
|
translation handlers create. We cannot compare inodes or other
|
|
stuff to match paths through symbolic links <em>etc.</em>
|
|
because that again would cost extra <code>stat()</code> system
|
|
calls which is not acceptable. This module may or may not work
|
|
with filenames rewritten by <code class="module"><a href="../mod/mod_alias.html">mod_alias</a></code> or
|
|
<code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>.</p>
|
|
|
|
<div class="example"><h3>Example</h3><p><code>
|
|
CacheFile /usr/local/apache/htdocs/index.html
|
|
</code></p></div>
|
|
|
|
</div>
|
|
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
|
|
<div class="directive-section"><h2><a name="MMapFile" id="MMapFile">MMapFile</a> <a name="mmapfile" id="mmapfile">지시어</a></h2>
|
|
<table class="directive">
|
|
<tr><th><a href="directive-dict.html#Description">설명:</a></th><td>Map a list of files into memory at startup time</td></tr>
|
|
<tr><th><a href="directive-dict.html#Syntax">문법:</a></th><td><code>MMapFile <var>file-path</var> [<var>file-path</var>] ...</code></td></tr>
|
|
<tr><th><a href="directive-dict.html#Context">사용장소:</a></th><td>주서버설정</td></tr>
|
|
<tr><th><a href="directive-dict.html#Status">상태:</a></th><td>Experimental</td></tr>
|
|
<tr><th><a href="directive-dict.html#Module">모듈:</a></th><td>mod_file_cache</td></tr>
|
|
</table>
|
|
<p>The <code class="directive">MMapFile</code> directive maps one or more files
|
|
(given as whitespace separated arguments) into memory at server
|
|
startup time. They are automatically unmapped on a server
|
|
shutdown. When the files have changed on the filesystem at
|
|
least a <code>HUP</code> or <code>USR1</code> signal should be send to
|
|
the server to re-<code>mmap()</code> them.</p>
|
|
|
|
<p>Be careful with the <var>file-path</var> arguments: They have
|
|
to literally match the filesystem path Apache's URL-to-filename
|
|
translation handlers create. We cannot compare inodes or other
|
|
stuff to match paths through symbolic links <em>etc.</em>
|
|
because that again would cost extra <code>stat()</code> system
|
|
calls which is not acceptable. This module may or may not work
|
|
with filenames rewritten by <code class="module"><a href="../mod/mod_alias.html">mod_alias</a></code> or
|
|
<code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>.</p>
|
|
|
|
<div class="example"><h3>Example</h3><p><code>
|
|
MMapFile /usr/local/apache/htdocs/index.html
|
|
</code></p></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="bottomlang">
|
|
<p><span>가능한 언어: </span><a href="../en/mod/mod_file_cache.html" hreflang="en" rel="alternate" title="English"> en </a> |
|
|
<a href="../ko/mod/mod_file_cache.html" title="Korean"> ko </a></p>
|
|
</div><div id="footer">
|
|
<p class="apache">Copyright 1999-2004 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="../faq/">FAQ</a> | <a href="../glossary.html">용어</a> | <a href="../sitemap.html">사이트맵</a></p></div>
|
|
</body></html> |