mirror of
https://github.com/apache/httpd.git
synced 2025-04-18 22:24:07 +03:00
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1912214 13f79535-47bb-0310-9956-ffa450edef68
342 lines
12 KiB
XML
342 lines
12 KiB
XML
<?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: 151408:1911948 (outdated) -->
|
|
|
|
<!--
|
|
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_alias.xml.meta">
|
|
|
|
<name>mod_alias</name>
|
|
<description>파일시스템의 다른 부분들을 문서 계층구조에 포함하고,
|
|
URL 리다이렉션을 제공한다</description>
|
|
<status>Base</status>
|
|
<sourcefile>mod_alias.c</sourcefile>
|
|
<identifier>alias_module</identifier>
|
|
|
|
<summary>
|
|
<p>이 모듈이 제공하는 지시어들을 사용하여 서버가 요청을
|
|
받을때 URL을 수정하거나 조작할 수 있다. <directive
|
|
module="mod_alias">Alias</directive>와 <directive
|
|
module="mod_alias">ScriptAlias</directive> 지시어는 URL을
|
|
파일시스템 경로로 대응한다. 그래서 <directive
|
|
module="core">DocumentRoot</directive> 아래에 없는 내용을
|
|
웹으로 서비스할 수 있다. 또, <directive
|
|
module="mod_alias">ScriptAlias</directive> 지시어는 지정한
|
|
디렉토리에 CGI 스크립트밖에 없다고 알린다.</p>
|
|
|
|
<p><directive module="mod_alias">Redirect</directive> 지시어는
|
|
클라이언트에게 다른 URL로 새로운 요청을 하도록 지시한다.
|
|
자원을 새로운 장소로 옮긴 경우 자주 사용한다.</p>
|
|
|
|
<p><module>mod_alias</module>는 간단한 URL 조작을 위해
|
|
설계되었다. 질의문자열 조작과 같은 복잡한 작업은
|
|
<module>mod_rewrite</module>가 제공하는 기능을 이용하라.</p>
|
|
|
|
</summary>
|
|
|
|
<seealso><module>mod_rewrite</module></seealso> <seealso><a
|
|
href="../urlmapping.html">URL을 파일시스템에 대응</a></seealso>
|
|
|
|
<section id="order"><title>처리 순서</title>
|
|
|
|
<p>서로 다른 사용장소에서 Alias와 Redirect를 사용하면 다른 지시어와
|
|
같이 표준 <a href="../sections.html#mergin">결합 방법</a>에
|
|
따라 처리한다. 그러나 같은 사용장소에 (예를 들어, 같은 <directive
|
|
type="section" module="core">VirtualHost</directive> 섹션에)
|
|
Alias와 Redirect를 사용하면 아래 순서대로 처리한다.</p>
|
|
|
|
<p>먼저 모든 Redirect를 처리한 후 Alias를 처리한다. 그래서
|
|
<directive module="mod_alias">Redirect</directive>나 <directive
|
|
module="mod_alias">RedirectMatch</directive>에 해당하는 요청은
|
|
절대로 Alias하지 않는다. 그리고 Alias와 Redirect는 설정파일에서
|
|
첫번째로 나오는 것을 사용한다.</p>
|
|
|
|
<p>그래서 여러 지시어가 동일한 하위경로에 해당하는 경우 모든
|
|
지시어를 적용하기위해서는 가장 상세한 경로를 먼저 사용해야 한다.
|
|
예를 들어, 다음 설정은 의도한대로 동작한다:</p>
|
|
|
|
<example>
|
|
Alias /foo/bar /baz<br />
|
|
Alias /foo /gaq
|
|
</example>
|
|
|
|
<p>그러나 위의 두 지시어 순서를 바꾸면 <code>/foo/bar</code>
|
|
<directive module="mod_alias">Alias</directive> 이전에
|
|
<code>/foo</code> <directive module="mod_alias">Alias</directive>를
|
|
적용하므로 항상 두번째 지시어를 무시한다.</p>
|
|
|
|
</section>
|
|
|
|
<directivesynopsis>
|
|
<name>Alias</name>
|
|
<description>URL을 특정 파일시스템 장소로 대응한다</description>
|
|
<syntax>Alias <var>URL-path</var>
|
|
<var>file-path</var>|<var>directory-path</var></syntax>
|
|
<contextlist><context>server config</context><context>virtual host</context>
|
|
</contextlist>
|
|
|
|
<usage>
|
|
|
|
<p><directive>Alias</directive> 지시어를 사용하면 파일시스템에서
|
|
<directive module="core">DocumentRoot</directive> 밖에 있는
|
|
문서도 서비스할 수 있다. <var>url-path</var>로 시작하는
|
|
(%로 인코딩된) URL을 <var>directory-path</var>로 시작하는
|
|
파일에 대응한다.</p>
|
|
|
|
<example><title>예제:</title>
|
|
Alias /image /ftp/pub/image
|
|
</example>
|
|
|
|
<p>http://myserver/image/foo.gif를 요청하면 서버는
|
|
/ftp/pub/image/foo.gif 파일을 넘겨준다.</p>
|
|
|
|
<p><var>url-path</var> 끝에 /를 포함하면, URL 끝에 /를
|
|
사용해야만 영향이 있음을 주의하라. 즉, <code>Alias /icons/
|
|
/usr/local/apache/icons/</code> 설정은 url <code>/icons</code>와
|
|
관계가 없다.</p>
|
|
|
|
<p>대응의 <em>대상</em>을 포함하는 여러 <directive
|
|
type="section" module="core">Directory</directive> 섹션이
|
|
필요할지도 모른다. 이 지시어는 <directive type="section"
|
|
module="core">Directory</directive> 섹션을 검사하기 전에
|
|
처리하므로, 대응의 대상만 섹션의 영향을 받는다. (그러나
|
|
<directive type="section" module="core">Location</directive>
|
|
섹션은 이 지시어를 처리하기 전에 한번만 검사하므로 지정한
|
|
URL 이하 전체에 영향을 준다.)</p>
|
|
|
|
<p>특히 <directive module="core">DocumentRoot</directive>
|
|
밖에 있는 디렉토리로 <code>Alias</code>를 만들었다면, 직접
|
|
대상 디렉토리의 접근을 허용해줘야 한다.</p>
|
|
|
|
<example><title>예제:</title>
|
|
Alias /image /ftp/pub/image<br />
|
|
<Directory /ftp/pub/image><br />
|
|
<indent>
|
|
Order allow,deny<br />
|
|
Allow from all<br />
|
|
</indent>
|
|
</Directory>
|
|
</example>
|
|
|
|
</usage>
|
|
</directivesynopsis>
|
|
|
|
<directivesynopsis>
|
|
<name>AliasMatch</name>
|
|
<description>정규표현식을 사용하여 URL을 파일시스템 장소로
|
|
대응한다</description>
|
|
<syntax>AliasMatch <var>regex</var>
|
|
<var>file-path</var>|<var>directory-path</var></syntax>
|
|
<contextlist><context>server config</context><context>virtual host</context>
|
|
</contextlist>
|
|
|
|
<usage>
|
|
<p>이 지시어는 <directive module="mod_alias">Alias</directive>와
|
|
같지만, 간단히 URL의 앞부분만 비교하는 대신 표준 정규표현식을
|
|
사용한다. 지정한 정규표현식을 URL 경로와 비교하여 맞다면,
|
|
서버는 괄호로 묶은 부분을 대체하여 파일명으로 사용한다.
|
|
예를 들어, 다음과 같이 <code>/icons</code> 디렉토리를 사용할
|
|
수 있다:</p>
|
|
|
|
<example>
|
|
AliasMatch ^/icons(.*) /usr/local/apache/icons$1
|
|
</example>
|
|
</usage>
|
|
</directivesynopsis>
|
|
|
|
<directivesynopsis>
|
|
<name>Redirect</name>
|
|
<description>클라이언트가 다른 URL에 접속하도록 요청하는 외부
|
|
리다이렉션을 보낸다</description>
|
|
<syntax>Redirect [<var>status</var>] <var>URL-path</var>
|
|
<var>URL</var></syntax>
|
|
<contextlist><context>server config</context><context>virtual host</context>
|
|
<context>directory</context><context>.htaccess</context></contextlist>
|
|
<override>FileInfo</override>
|
|
|
|
<usage>
|
|
<p>Redirect 지시어는 이전 URL을 새로운 URL로 대응한다.
|
|
클라이언트에게 새로운 URL을 보내고, 클라이언트는 새로운
|
|
주소로 다시 한번 접속한다. (%로 인코딩된) <var>URL-path</var>로
|
|
시작하는 요청을 받으면 (%로 인코딩된) <var>URL</var>로 시작하는
|
|
새로운 URL로 리다이렉션 오류를 보낸다.</p>
|
|
|
|
<example><title>예제:</title>
|
|
Redirect /service http://foo2.bar.com/service
|
|
</example>
|
|
|
|
<p>클라이언트가 http://myserver/service/foo.txt를 요청하면
|
|
대신 http://foo2.bar.com/service/foo.txt에 접근하라는 응답을
|
|
받는다.</p>
|
|
|
|
<note><title>주의</title> <p>Redirect 지시어는 설정파일에서
|
|
나오는 순서와 관계없이 Alias와 ScriptAlias 지시어보다 우선순위가
|
|
높다. 또, .htaccess 파일이나 <directive type="section"
|
|
module="core">Directory</directive> 섹션에서 사용하더라도
|
|
<var>URL-path</var>에는 상대경로가 아니라 반드시 완전한 URL을
|
|
사용해야 한다.</p></note>
|
|
|
|
<p><var>status</var> 아규먼트를 지정하지않으면, "임시
|
|
(temporary)" (HTTP 상태 302) 리다이렉션을 보낸다. 즉,
|
|
클라이언트에게 자원을 임시로 옮겼다고 알린다. <var>status</var>
|
|
아규먼트를 사용하여 다른 HTTP 상태코드를 반환할 수 있다:</p>
|
|
|
|
<dl>
|
|
<dt>permanent</dt>
|
|
|
|
<dd>자원을 완전히 옮겼음을 뜻하는 영구 리다이렉션 상태를
|
|
(301) 반환한다.</dd>
|
|
|
|
<dt>temp</dt>
|
|
|
|
<dd>임시 리다이렉션 상태를 (302) 반환한다. 기본값이다.</dd>
|
|
|
|
<dt>seeother</dt>
|
|
|
|
<dd>자원이 교체되었음을 뜻하는 "참조 (See Other)" 상태를
|
|
(303) 반환한다.</dd>
|
|
|
|
<dt>gone</dt>
|
|
|
|
<dd>자원이 영구히 삭제되었음을 뜻하는 "소멸 (Gone)" 상태를
|
|
(410) 반환한다. 이 상태를 사용하면 <var>URL</var> 아규먼트를
|
|
사용할 수 없다.</dd>
|
|
</dl>
|
|
|
|
<p><var>status</var>에 숫자 상태코드를 사용하여 다른 상태코드도
|
|
반환할 수 있다. 상태가 300과 399 사이라면 <var>URL</var>
|
|
아규먼트를 사용해야 하고, 아니라면 생략해야 한다. 단, 아파치
|
|
코드에 상태가 정의되있어야 한다 (http_protocol.c의
|
|
<code>send_error_response</code> 함수 참고).</p>
|
|
|
|
<example><title>예제:</title>
|
|
Redirect permanent /one http://example.com/two<br />
|
|
Redirect 303 /three http://example.com/other
|
|
</example>
|
|
|
|
</usage>
|
|
</directivesynopsis>
|
|
|
|
<directivesynopsis>
|
|
<name>RedirectMatch</name>
|
|
<description>현재 URL이 정규표현식에 해당하면 외부 리다이렉션을
|
|
보낸다</description>
|
|
<syntax>RedirectMatch [<var>status</var>] <var>regex</var>
|
|
<var>URL</var></syntax>
|
|
<contextlist><context>server config</context><context>virtual host</context>
|
|
<context>directory</context><context>.htaccess</context></contextlist>
|
|
<override>FileInfo</override>
|
|
|
|
<usage>
|
|
<p>이 지시어는 <directive
|
|
module="mod_alias">Redirect</directive>와 같지만, 간단히
|
|
URL의 앞부분만 비교하는 대신 표준 정규표현식을 사용한다.
|
|
지정한 정규표현식을 URL 경로와 비교하여 맞다면, 서버는 괄호로
|
|
묶은 부분을 대체하여 파일명으로 사용한다. 예를 들어, 다음은
|
|
모든 GIF 파일 요청에 대해 다른 서버의 비슷한 이름을 가진
|
|
JPEG 파일로 리다이렉션을 보낸다:</p>
|
|
|
|
<example>
|
|
RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg
|
|
</example>
|
|
</usage>
|
|
</directivesynopsis>
|
|
|
|
<directivesynopsis>
|
|
<name>RedirectTemp</name>
|
|
<description>클라이언트가 다른 URL에 접속하도록 요청하는 외부
|
|
임시 리다이렉션을 보낸다</description>
|
|
<syntax>RedirectTemp <var>URL-path</var> <var>URL</var></syntax>
|
|
<contextlist><context>server config</context><context>virtual host</context>
|
|
<context>directory</context><context>.htaccess</context></contextlist>
|
|
<override>FileInfo</override>
|
|
|
|
<usage>
|
|
<p>이 지시어는 클라이언트에게 리다이렉션이 임시적임을 (상태
|
|
302) 알린다. <code>Redirect temp</code>와 정확히 같다.</p>
|
|
</usage>
|
|
</directivesynopsis>
|
|
|
|
<directivesynopsis>
|
|
<name>RedirectPermanent</name>
|
|
<description>클라이언트가 다른 URL에 접속하도록 요청하는 외부
|
|
영구 리다이렉션을 보낸다</description>
|
|
<syntax>RedirectPermanent <var>URL-path</var> <var>URL</var></syntax>
|
|
<contextlist><context>server config</context><context>virtual host</context>
|
|
<context>directory</context><context>.htaccess</context></contextlist>
|
|
<override>FileInfo</override>
|
|
|
|
<usage>
|
|
<p>이 지시어는 클라이언트에게 리다이렉션이 영구적임을 (상태
|
|
301) 알린다. <code>Redirect permanent</code>와 정확히 같다.</p>
|
|
</usage>
|
|
</directivesynopsis>
|
|
|
|
<directivesynopsis>
|
|
<name>ScriptAlias</name>
|
|
<description>URL을 특정 파일시스템 장소로 대응하고 대상이 CGI
|
|
스크립트라고 알린다</description>
|
|
<syntax>ScriptAlias <var>URL-path</var>
|
|
<var>file-path</var>|<var>directory-path</var></syntax>
|
|
<contextlist><context>server config</context><context>virtual host</context>
|
|
</contextlist>
|
|
|
|
<usage>
|
|
<p><directive>ScriptAlias</directive> 지시어는 <directive
|
|
module="mod_alias">Alias</directive> 지시어와 비슷하지만,
|
|
추가로 대상 디렉토리에 <module >mod_cgi</module>의 cgi-script
|
|
핸들러가 처리할 CGI 스크립트가 있다고 알린다.
|
|
<var>URL-path</var>로 시작하는 (%로 인코딩된) URL을 파일시스템의
|
|
절대경로인 두번째 아규먼트로 시작하는 스크립트에 대응한다.</p>
|
|
|
|
<example><title>예제:</title>
|
|
ScriptAlias /cgi-bin/ /web/cgi-bin/
|
|
</example>
|
|
|
|
<p><code>http://myserver/cgi-bin/foo</code>를 요청하면 서버는
|
|
<code>/web/cgi-bin/foo</code> 스크립트를 실행한다.</p>
|
|
</usage>
|
|
</directivesynopsis>
|
|
|
|
<directivesynopsis>
|
|
<name>ScriptAliasMatch</name>
|
|
<description>정규표현식을 사용하여 URL을 특정 파일시스템 장소로
|
|
대응하고 대상이 CGI 스크립트라고 알린다</description>
|
|
<syntax>ScriptAliasMatch <var>regex</var>
|
|
<var>file-path</var>|<var>directory-path</var></syntax>
|
|
<contextlist><context>server config</context><context>virtual host</context>
|
|
</contextlist>
|
|
|
|
<usage>
|
|
<p>이 지시어는 <directive
|
|
module="mod_alias">ScriptAlias</directive>와 같지만, 간단히
|
|
URL의 앞부분만 비교하는 대신 표준 정규표현식을 사용한다.
|
|
지정한 정규표현식을 URL 경로와 비교하여 맞다면, 서버는 괄호로
|
|
묶은 부분을 대체하여 파일명으로 사용한다. 예를 들어, 다음과
|
|
같이 표준적인 <code>/cgi-bin</code>을 사용할 수 있다:</p>
|
|
|
|
<example>
|
|
ScriptAliasMatch ^/cgi-bin(.*) /usr/local/apache/cgi-bin$1
|
|
</example>
|
|
</usage>
|
|
</directivesynopsis>
|
|
|
|
</modulesynopsis>
|
|
|