<?xml version="1.0" encoding="EUC-KR" ?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.ko.xsl"?>
<!-- English Revision: 421174 -->

<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

<modulesynopsis metafile="mod_example.xml.meta">

<name>mod_example</name>
<description>아파치 모듈 API를 설명한다</description>
<status>Experimental</status>
<sourcefile>mod_example.c</sourcefile>
<identifier>example_module</identifier>

<summary>
<note type="warning">
      이 문서는 아파치 웹서버 2.0 버전에서 변경된 내용을 담고
      있지 않다. 아직도 유효한 정보가 있지만, 주의해서 사용하길
      바란다.
</note>

    <p>아파치 배포본 <code>src/modules/example 디렉토리</code>에
    있는 파일들은 아파치 API를 사용하여 모듈을 작성하려는 사람들을
    돕기위한 예제다.</p>

    <p><code>mod_example.c</code>는 모든 콜백(callback) 구조와
    호출 문법을 설명하는 파일이다. 당신은 모듈에 이 모든 콜백을
    구현할 필요가 없다. 사실 정반대다!</p>

    <p>example 모듈은 실제로 동작하는 모듈이다. 이 모듈을 서버에
    연결하고 특정 위치에 "example-handler" 핸들러를 할당하여
    그곳을 브라우징하면 example 모듈의 여러 콜백을 확인할 수
    있다.</p>
</summary>

<section id="compiling"><title>example 모듈 컴파일하기</title>

    <p>서버에 example 모듈을 포함하려면 다음 과정을 거친다:</p>

    <ol>
      <li>
        <code>src/Configuration</code> 파일 아래 부분에 있는
        "AddModule modules/example/mod_example" 줄의 주석처리를
        없앤다. 이런 줄이 없다면, 다음과 같은 줄을 추가한다.
<example>
     AddModule modules/example/mod_example.o
</example>
      </li>

      <li><code>src/Configure</code> 스크립트를 실행한다
      ("<code>cd&nbsp;src;&nbsp;./Configure</code>"). 그러면
      서버 자체 Makefile을 만들고, 하위디렉토리에 있는 요청한
      추가 모듈을 <code>src/modules/Makefile</code>에 추가한다.</li>

      <li>서버를 컴파일한다 (<code>src</code> 디렉토리에 있는
      "<code>make</code>"를 실행한다).</li>
    </ol>

    <p>자신이 만든 모듈을 추가하려면:</p>

    <ol type="A">
      <li><code>mkdir src/modules/<em>mymodule</em></code></li>

      <li><code>cp src/modules/example/*
      src/modules/<em>mymodule</em></code></li>

      <li>새로 만든 디렉토리에 있는 파일을 수정한다.</li>

      <li>적절히 수정하여 위의 [1]에서 [3]까지 과정을 진행한다.</li>
    </ol>
</section>

<section id="using"><title><code>mod_example</code> 모듈 사용하기</title>

    <p>example 모듈을 사용하려면 <code>srm.conf</code> 파일에
    다음과 같은 설정을 추가하라:</p>
<example>
   &lt;Location /example-info&gt;<br />
       SetHandler example-handler<br />
   &lt;/Location&gt;
</example>

    <p>아니면 <a
    href="core.html#accessfilename"><code>.htaccess</code></a>
    파일에 다음과 같은 내용을 추가하고, 그 위치에서 "test.example"
    같은 파일을 요청하라:</p>
<example>
   AddHandler example-handler .example
</example>

    <p>서버를 재시작한 후 이 위치를 브라우징하면 앞에서 말한
    내용을 보게될 것이다.</p>
</section>

<directivesynopsis>
<name>Example</name>
<description>아파치 모듈 API를 설명하기위한 예제 지시어</description>
<syntax>Example</syntax>
<contextlist><context>server config</context>
<context>virtual host</context><context>directory</context>
<context>.htaccess</context></contextlist>

<usage>
    <p><directive>Example</directive> 지시어는 example 모듈의
    내용핸들러가 간단한 문구를 보일지 여부를 설정한다. 이 지시어는
    아규먼트를 받지않는다. example 내용핸들러를 적용한 URL에
    접속하면 문서 요청을 서비스하기위해 모듈안에 함수들이 어떻게
    그리고 어떤 순서로 불리는지 알 수 있다. 이 지시어의 효과는
    "<code>Example directive declared here: YES/NO</code>"로
    확인할 수 있다.</p>
</usage>
</directivesynopsis>

</modulesynopsis>
