examples.xml.ko revision 6aadbc6fd703e73d1d419e9f06b84a4338c898f1
<?xml version='1.0' encoding='EUC-KR' ?>
<!DOCTYPE manualpage SYSTEM "/style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="/style/manual.ko.xsl"?>
<!-- English Revision: 1.10 -->
<!--
Copyright 2003-2004 The Apache Software Foundation
Licensed 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.
-->
<manualpage metafile="examples.xml.meta">
<parentdocument href="./">����ȣ��Ʈ</parentdocument>
<title>����ȣ��Ʈ ��</title>
<summary>
<p>�� ������ ���� ���ǵǴ� ����ȣ��Ʈ
�� ���� �Ϸ��� ��������. ��Ȳ�� <a
href="name-based.html">�̸����</a>�̳� <a
href="ip-based.html">IP���</a> ����ȣ��Ʈ�� ���� �� ��������
���� ������Ʈ�� �����Ϸ��� ����̴�. �� ���Ͻ� ���� �ڿ���
���� ������ ����Ͽ� ����Ʈ�� ��ϴ� ��츦 �ٷ� ������
�� ���� ���̴�.</p>
</summary>
<section id="purename"><title>IP �ּ� �Ѱ��� ���� �̸����
������Ʈ ��ϱ�.</title>
<p>������ IP �ּҰ� �Ѱ� �ְ�, DNS���� ���� �ּ�(CNAMES)��
�� ��ǻ�͸� ����Ų��. �� ��ǻ�Ϳ��� <code>www.example.com</code>��
<code>www.example.org</code>�� �������� �����ϰ� �ʹ�.</p>
<note><title>Note</title><p>����ġ ������ ����ȣ��Ʈ ������
�Ѵٰ� �� ȣ��Ʈ�? ���� DNS �׸��� �ڵ��̷� �����
�ʴ´�. <em>�ݵ��</em> DNS�� IP �ּҸ� ����Ű��
�̸��� �־�� �Ѵ�. �ȱ׷��� �ƹ��� ������Ʈ�� ��
�� ���. �˻��غ��� ���� <code>hosts</code> ���Ͽ� �׸���
�߰��� �� ������, �̴� hosts �׸��� ���� ��ǻ�Ϳ���
�ݿ��ȴ�.</p>
</note>
<example>
<title>���� ����</title>
# ����ġ�� ��Ʈ 80�� ��ٸ���<br />
Listen 80<br />
<br />
# ��� IP �ּҿ��� ����ȣ��Ʈ ��û�� ��ٸ���<br />
NameVirtualHost *:80<br />
<br />
&lt;VirtualHost *:80&gt;<br />
<indent>
DocumentRoot /www/example1<br />
ServerName www.example.com<br />
<br />
# �ٸ� ���þ�鵵 �ִ�<br />
<br />
</indent>
&lt;/VirtualHost&gt;<br />
<br />
&lt;VirtualHost *:80&gt;<br />
<indent>
DocumentRoot /www/example2<br />
ServerName www.example.org<br />
<br />
# �ٸ� ���þ�鵵 �ִ�<br />
<br />
</indent>
&lt;/VirtualHost&gt;
</example>
<p>��ǥ�� ��� �ּҸ� ����Ű�Ƿ�, �ּ����� � ��û��
�������� �ʴ´�. <code>www.example.com</code>��
�������Ͽ� ó������ �����Ƿ� ���� ���� �켱������ ������,
<cite>�⺻</cite>Ȥ�� <cite>�ʱ�</cite> ������ �ȴ�.
� <code>ServerName</code> ���þ�� �ش�����ʴ� ��û��
ù��° <code>VirtualHost</code>�� �����Ѵ�.</p>
<note>
<title>����</title>
<p>���Ѵٸ� <code>*</code> ��� �ý����� ���� IP
�ּҸ� ����� �� �ִ�. �� ���
<code>VirtualHost</code>�� �ƱԸ�Ʈ��
<code>NameVirtualHost</code>�� �ƱԸ�Ʈ�� ��ġ�ؾ�
<em>�Ѵ�</em>:</p>
<example>
NameVirtualHost 172.20.30.40<br />
<br />
&lt;VirtualHost 172.20.30.40&gt;<br />
# �� ...
</example>
<p>�׷��� ISP���� �������� IP �ּҸ� �������� ��
IP �ּҸ� �𸣴� ��쿡�� <code>*</code>�� ����ϴ�
���� �����ϴ�. <code>*</code>�� ��� IP �ּҿ�
�ش��ϹǷ�, IP �ּҰ� ����Ǿ ������ ������
�ʿ䰡 ���.</p>
</note>
<p>���� ��κ��� �̸���� ����ȣ��Ʈ ������ ���� ����.
���ܴ� �ٸ� IP �ּҳ� ��Ʈ�� �ٸ� ������ �����Ϸ���
����̴�.</p>
</section>
<section id="twoips"><title>���� IP �ּҿ��� �̸����
ȣ��Ʈ.</title>
<note>
<title>����</title><p>���⼭ ������ ����� IP �ּҰ�
��� ��밡���ϴ�.</p>
</note>
<p>������ IP �ּҰ� �ΰ��ִ�. �ϳ�����
(<code>172.20.30.40</code>) "��" ����
<code>server.domain.com</code>�� �����ϰ�, �ٸ� �ϳ�����
(<code>172.20.30.50</code>) ���� ����ȣ��Ʈ�� ������
���̴�.</p>
<example>
<title>���� ����</title>
Listen 80<br />
<br />
# 172.20.30.40���� �����ϴ� "��"�����̴�<br />
ServerName server.domain.com<br />
DocumentRoot /www/mainserver<br />
<br />
# �ٸ� �ּҴ�<br />
NameVirtualHost 172.20.30.50<br />
<br />
&lt;VirtualHost 172.20.30.50&gt;<br />
<indent>
DocumentRoot /www/example1<br />
ServerName www.example.com<br />
<br />
# �ٸ� ���þ�鵵 �ִ� ...<br />
<br />
</indent>
&lt;/VirtualHost&gt;<br />
<br />
&lt;VirtualHost 172.20.30.50&gt;<br />
<indent>
DocumentRoot /www/example2<br />
ServerName www.example.org<br />
<br />
# �ٸ� ���þ�鵵 �ִ� ...<br />
<br />
</indent>
&lt;/VirtualHost&gt;
</example>
<p><code>172.20.30.50</code>�� �ƴ� �ּҿ� ���� ��û��
�ּ����� �����Ѵ�. ȣ��Ʈ�� ����, �� <code>Host:</code>
������� <code>172.20.30.50</code>�� ��û�ϸ�
<code>www.example.com</code>�� �����Ѵ�.</p>
</section>
<section id="intraextra"><title>(���ο� �ܺ� �ּҿ� ����)
�ٸ� IP �ּҷ� ���� ������ �����ϱ�.</title>
<p>���� ��ǻ�Ϳ� IP �ּҰ� �ΰ� (<code>192.168.1.1</code>��
<code>172.20.30.40</code>) �ִ�. ��ǻ�ʹ� ���� (��Ʈ���)
��Ʈ���� �ܺ� (���ͳ�) ��Ʈ�� ���̿� ��ġ�Ѵ�. ��Ʈ�� �ۿ���
<code>server.example.com</code>�� �ܺ� �ּҸ�
(<code>172.20.30.40</code>) �ǹ��ϰ�, ��Ʈ�� ���ο��� ����
�̸��� ���� �ּҷ� (<code>192.168.1.1</code>) ����Ѵ�.</p>
<p>������ <code>VirtualHost</code> ���� �Ѱ��� ���ο� �ܺ�
���信 ���� ������ ������ �� �ִ�.</p>
<example>
<title>���� ����</title>
NameVirtualHost 192.168.1.1<br />
NameVirtualHost 172.20.30.40<br />
<br />
&lt;VirtualHost 192.168.1.1 172.20.30.40&gt;<br />
<indent>
DocumentRoot /www/server1<br />
ServerName server.example.com<br />
ServerAlias server<br />
</indent>
&lt;/VirtualHost&gt;
</example>
<p>���� �� ��Ʈ������ ���� ��û�� ����
<code>VirtualHost</code>���� �����Ѵ�.</p>
<note>
<title>����:</title><p>���� ��Ʈ�������� ������ ȣ��Ʈ��
<code>server.example.com</code> ��� �̸�
<code>server</code>�� �����ϴ�.</p>
<p>���� ���� ������ IP �ּ� ��� <code>*</code>��
����Ͽ� ������ ��� �ּҿ� �����ϰ� ������ ��
�ִ�.</p>
</note>
</section>
<section id="port"><title>���� ��Ʈ���� ���� �ٸ� ����Ʈ
��ϱ�.</title>
<p>���� IP�� ���� ��Ʈ���� ���� �ٸ� �������� �����Ѵٰ�
��������. �̴� "NameVirtualHost" �±׿� ��Ʈ�� �����ϸ�
�����ϴ�. NameVirtualHost name:port���� &lt;VirtualHost
name:port&gt;�� Ȥ�� Listen ���þ ����ϸ� �ȵȴ�.</p>
<example>
<title>���� ����</title>
Listen 80<br />
Listen 8080<br />
<br />
NameVirtualHost 172.20.30.40:80<br />
NameVirtualHost 172.20.30.40:8080<br />
<br />
&lt;VirtualHost 172.20.30.40:80&gt;<br />
<indent>
ServerName www.example.com<br />
DocumentRoot /www/domain-80<br />
</indent>
&lt;/VirtualHost&gt;<br />
<br />
&lt;VirtualHost 172.20.30.40:8080&gt;<br />
<indent>
ServerName www.example.com<br />
DocumentRoot /www/domain-8080<br />
</indent>
&lt;/VirtualHost&gt;<br />
<br />
&lt;VirtualHost 172.20.30.40:80&gt;<br />
<indent>
ServerName www.example.org<br />
DocumentRoot /www/otherdomain-80<br />
</indent>
&lt;/VirtualHost&gt;<br />
<br />
&lt;VirtualHost 172.20.30.40:8080&gt;<br />
<indent>
ServerName www.example.org<br />
DocumentRoot /www/otherdomain-8080<br />
</indent>
&lt;/VirtualHost&gt;
</example>
</section>
<section id="ip"><title>IP��� ����ȣ��Ʈ</title>
<p>������ ���� <code>www.example.com</code>��
<code>www.example.org</code>�� �ش��ϴ� �� IP �ּҸ�
(<code>172.20.30.40</code>�� <code>172.20.30.50</code>)
�����.</p>
<example>
<title>���� ����</title>
Listen 80<br />
<br />
&lt;VirtualHost 172.20.30.40&gt;<br />
<indent>
DocumentRoot /www/example1<br />
ServerName www.example.com<br />
</indent>
&lt;/VirtualHost&gt;<br />
<br />
&lt;VirtualHost 172.20.30.50&gt;<br />
<indent>
DocumentRoot /www/example2<br />
ServerName www.example.org<br />
</indent>
&lt;/VirtualHost&gt;
</example>
<p><code>&lt;VirtualHost&gt;</code> ���þ�� ������ �ּҿ�
�ش������ʴ� �ּҷ� (���� ���, <code>localhost</code>)
��û�� ������ �ּ����� �ִ� ��� �ּ����� �����Ѵ�.</p>
</section>
<section id="ipport"><title>��Ʈ��ݰ� ip����� ȥ�յ�
����ȣ��Ʈ</title>
<p>������ ���� <code>www.example.com</code>��
<code>www.example.org</code>�� �ش��ϴ� �� IP �ּҸ�
(<code>172.20.30.40</code>�� <code>172.20.30.50</code>)
�����. �� IP�� 80��� 8080�� ��Ʈ�� ����ȣ��Ʈ�� ������.</p>
<example>
<title>���� ����</title>
Listen 172.20.30.40:80<br />
Listen 172.20.30.40:8080<br />
Listen 172.20.30.50:80<br />
Listen 172.20.30.50:8080<br />
<br />
&lt;VirtualHost 172.20.30.40:80&gt;<br />
<indent>
DocumentRoot /www/example1-80<br />
ServerName www.example.com<br />
</indent>
&lt;/VirtualHost&gt;<br />
<br />
&lt;VirtualHost 172.20.30.40:8080&gt;<br />
<indent>
DocumentRoot /www/example1-8080<br />
ServerName www.example.com<br />
</indent>
&lt;/VirtualHost&gt;<br />
<br />
&lt;VirtualHost 172.20.30.50:80&gt;<br />
<indent>
DocumentRoot /www/example2-80<br />
ServerName www.example.org<br />
</indent>
&lt;/VirtualHost&gt;<br />
<br />
&lt;VirtualHost 172.20.30.50:8080&gt;<br />
<indent>
DocumentRoot /www/example2-8080<br />
ServerName www.example.org<br />
</indent>
&lt;/VirtualHost&gt;
</example>
</section>
<section id="mixed"><title>�̸���ݰ� IP����� ȥ�յ�
����ȣ��Ʈ</title>
<p>�ּ��� ����� �̸���� ����ȣ��Ʈ��, �ٸ� ���� IP���
����ȣ��Ʈ�� �����ϰ� �ʹ�.</p>
<example>
<title>���� ����</title>
Listen 80<br />
<br />
NameVirtualHost 172.20.30.40<br />
<br />
&lt;VirtualHost 172.20.30.40&gt;<br />
<indent>
DocumentRoot /www/example1<br />
ServerName www.example.com<br />
</indent>
&lt;/VirtualHost&gt;<br />
<br />
&lt;VirtualHost 172.20.30.40&gt;<br />
<indent>
DocumentRoot /www/example2<br />
ServerName www.example.org<br />
</indent>
&lt;/VirtualHost&gt;<br />
<br />
&lt;VirtualHost 172.20.30.40&gt;<br />
<indent>
DocumentRoot /www/example3<br />
ServerName www.example3.net<br />
</indent>
&lt;/VirtualHost&gt;<br />
<br />
# IP-���<br />
&lt;VirtualHost 172.20.30.50&gt;<br />
<indent>
DocumentRoot /www/example4<br />
ServerName www.example4.edu<br />
</indent>
&lt;/VirtualHost&gt;<br />
<br />
&lt;VirtualHost 172.20.30.60&gt;<br />
<indent>
DocumentRoot /www/example5<br />
ServerName www.example5.gov<br />
</indent>
&lt;/VirtualHost&gt;
</example>
</section>
<section id="default"><title><code>_default_</code> ����ȣ��Ʈ
����ϱ�</title>
<section id="defaultallports"><title>��� ��Ʈ�� ����
<code>_default_</code> ����ȣ��Ʈ</title>
<p>� ����ȣ��Ʈ���� �ش��������� IP �ּҿ� ��Ʈ�� ����
<em>���</em> ��û�� ó���ϱ�.</p>
<example>
<title>���� ����</title>
&lt;VirtualHost _default_:*&gt;<br />
<indent>
DocumentRoot /www/default<br />
</indent>
&lt;/VirtualHost&gt;
</example>
<p>default(�⺻) ����ȣ��Ʈ�� ��Ʈ�� ���ϵ�ī�带 ����Ͽ� � ��û��
�ּ����� ���� �����.</p>
<p>default ����ȣ��Ʈ�� ���� �̸���� ����ȣ��Ʈ�� ����ϴ�
�ּ�/��Ʈ���� ��û�� �������� �ʴ´�. �� �� ��ų�
<code>Host:</code> ����� ��� ��û�� �׻� ������ �̸����
����ȣ��Ʈ(�������Ͽ���
�ּ�/��Ʈ�� ó������ ���� ����ȣ��Ʈ)�� �����Ѵ�.</p>
<p><directive module="mod_alias">AliasMatch</directive>��
<directive module="mod_rewrite">RewriteRule</directive>��
����Ͽ� � ��û�� Ư�� ������(Ȥ�� ��ũ��Ʈ)��
���ۼ���(rewrite) �� �ִ�.</p>
</section>
<section id="defaultdifferentports"><title>���� ��Ʈ�� ����
<code>_default_</code> ����ȣ��Ʈ</title>
<p>���� ���� ������, ������ ���� ��Ʈ�� ��ٸ��� 80��
��Ʈ�� ���ؼ� �߰��� <code>_default_</code> ����ȣ��Ʈ��
����ϰ� �ʹ�.</p>
<example>
<title>���� ����</title>
&lt;VirtualHost _default_:80&gt;<br />
<indent>
DocumentRoot /www/default80<br />
# ...<br />
</indent>
&lt;/VirtualHost&gt;<br />
<br />
&lt;VirtualHost _default_:*&gt;<br />
<indent>
DocumentRoot /www/default<br />
# ...<br />
</indent>
&lt;/VirtualHost&gt;
</example>
<p>80�� ��Ʈ�� ���� default ����ȣ��Ʈ�� (<em>�ݵ��</em>
���ϵ�ī�� ��Ʈ�� ���� �⺻ ����ȣ��Ʈ ���� ���;� �Ѵ�)
������������ IP �ּҷ� ������ ��� ��û�� �����Ѵ�.
�ּ����� ���� ��û�� �������� ���Ѵ�.</p>
</section>
<section id="defaultoneport"><title>�� ��Ʈ�� ����
<code>_default_</code> ����ȣ��Ʈ</title>
<p>80�� ��Ʈ�� ���ؼ��� default ����ȣ��Ʈ�� ����� �ʹ�.</p>
<example>
<title>���� ����</title>
&lt;VirtualHost _default_:80&gt;<br />
DocumentRoot /www/default<br />
...<br />
&lt;/VirtualHost&gt;
</example>
<p>��Ʈ 80�� ������������ �ּҿ� ���� ��û�� �⺻
����ȣ��Ʈ�� �����ϰ�, �ٸ� ������������ �ּҿ� ��Ʈ��
���� ��û�� �� ������ �����Ѵ�.</p>
</section>
</section>
<section id="migrate"><title>�̸���� ����ȣ��Ʈ�� IP���
����ȣ��Ʈ�� �ű��</title>
<p>(<a href="#name">�̸����</a>�� ù��° ������) ȣ��Ʈ��
<code>www.example.org</code>�� ���� �̸���� ����ȣ��Ʈ��
�ڽ��� IP �ּҸ� ������ �Ѵ�. �̸���� ����ȣ��Ʈ�� ����
IP �ּҸ� ij���ϴ� ���Ӽ����� ���Ͻÿ��� ������ ���ϱ�����
�ű�� ���� �� ��θ� �����ϰ� �ʹ�.<br /> �����
<code>VirtualHost</code> ���þ �� IP �ּҸ���
(<code>172.20.30.50</code>) �߰��ϸ�ǹǷ� ����.</p>
<example>
<title>���� ����</title>
Listen 80<br />
ServerName www.example.com<br />
DocumentRoot /www/example1<br />
<br />
NameVirtualHost 172.20.30.40<br />
<br />
&lt;VirtualHost 172.20.30.40 172.20.30.50&gt;<br />
<indent>
DocumentRoot /www/example2<br />
ServerName www.example.org<br />
# ...<br />
</indent>
&lt;/VirtualHost&gt;<br />
<br />
&lt;VirtualHost 172.20.30.40&gt;<br />
<indent>
DocumentRoot /www/example3<br />
ServerName www.example.net<br />
ServerAlias *.example.net<br />
# ...<br />
</indent>
&lt;/VirtualHost&gt;
</example>
<p>���� (IP��� ����ȣ��Ʈ�� ����) ���ο� �ּҿ� (�̸����
����ȣ��Ʈ�� ����) ���� �ּ� ��� ����ȣ��Ʈ�� ������
�� �ִ�.</p>
</section>
<section id="serverpath"><title><code>ServerPath</code>
���þ� ����ϱ�</title>
<p>�� �̸���� ����ȣ��Ʈ�� ���� ������ �ִ�. �ùٸ�
����ȣ��Ʈ�� �����ϱ����� Ŭ���̾�Ʈ�� �ùٸ�
<code>Host:</code> ����� ������ �Ѵ�. ������ HTTP/1.0
Ŭ���̾�Ʈ�� �� ����� ������ ���ϸ� ����ġ�� Ŭ���̾�Ʈ��
� ����ȣ��Ʈ�� �������ϴ��� �� �� ��� (�׷��� ������
����ȣ��Ʈ�� ��û�� �����Ѵ�). ������ ������� ������ ȣȯ��
�����ϱ����� ������ ����ȣ��Ʈ�� �����, ���⿡ �̸����
����ȣ��Ʈ�� URL ���λ縦 �����ϴ� ��ũ ��� ��������
�д�.</p>
<example>
<title>���� ����</title>
NameVirtualHost 172.20.30.40<br />
<br />
&lt;VirtualHost 172.20.30.40&gt;<br />
<indent>
# primary vhost<br />
DocumentRoot /www/subdomain<br />
RewriteEngine On<br />
RewriteRule ^/.* /www/subdomain/index.html<br />
# ...<br />
</indent>
&lt;/VirtualHost&gt;<br />
<br />
&lt;VirtualHost 172.20.30.40&gt;<br />
DocumentRoot /www/subdomain/sub1<br />
<indent>
ServerName www.sub1.domain.tld<br />
ServerPath /sub1/<br />
RewriteEngine On<br />
RewriteRule ^(/sub1/.*) /www/subdomain$1<br />
# ...<br />
</indent>
&lt;/VirtualHost&gt;<br />
<br />
&lt;VirtualHost 172.20.30.40&gt;<br />
<indent>
DocumentRoot /www/subdomain/sub2<br />
ServerName www.sub2.domain.tld<br />
ServerPath /sub2/<br />
RewriteEngine On<br />
RewriteRule ^(/sub2/.*) /www/subdomain$1<br />
# ...<br />
</indent>
&lt;/VirtualHost&gt;
</example>
<p><directive module="core">ServerPath</directive> ���þ����
URL <code>http://www.sub1.domain.tld/sub1/</code>�� ����
��û�� <em>�׻�</em> subl-����ȣ��Ʈ�� �����Ѵ�.<br />
Ŭ���̾�Ʈ�� �ùٸ� <code>Host:</code> ����� �����ٸ�,
URL <code>http://www.sub1.domain.tld/</code>�� ���� ��û��
subl-����ȣ��Ʈ������ �����Ѵ�. ���� <code>Host:</code> �����
������������ Ŭ���̾�Ʈ�� ������ ȣ��Ʈ�� �ִ� ������������
���Եȴ�.<br /> ���⿡ ������ ������ �����϶�: Ŭ���̾�Ʈ��
<code>Host:</code> ����� ������������
<code>http://www.sub2.domain.tld/sub1/</code>�� ���� ��û��
subl-����ȣ��Ʈ�� �����Ѵ�.<br />
<directive module="mod_rewrite">RewriteRule</directive>
���þ ����Ͽ� �ùٸ� <code>Host:</code> ����� ������
Ŭ���̾�Ʈ�� (<em>���� ���</em>, URL ��ġ�簡 �ְų� ���)
�� URL�� ��� ����� �� �ִ�.</p>
</section>
</manualpage>