Apache HTTP Server Version 2.4
�� ������ ��û�� URL�� ������ ����ġ�� ��� ������ ������ ���Ͻý��ۻ� ��ġ�� ã���� �����Ѵ�.
���õ� ��� | ���õ� ���þ� |
---|---|
��û�� ���� ����ġ�� � ������ �������� �����ϱ�����
�⺻������ ��û�� URL-���(URL���� ȣ��Ʈ���� ��Ʈ �ڿ�
������ �κ�)�� �������Ͽ��� ������ DocumentRoot
�ڿ� ���δ�. ����
DocumentRoot
�Ʒ��ִ�
���ϰ� ���丮���� ������ ���Ե� �⺻���� �����̴�.
���� ���Ͻý��ۿ��� DocumentRoot
�Ʒ� �������� �κ���
������ ������ �ʿ䰡 �ִ�. ����ġ�� �� ��� �������� �����
����� �� �ִ�. ���н� �ý��ۿ��� �ɺ���ũ�� ����Ͽ�
���Ͻý����� �ٸ� �κ��� DocumentRoot
�Ʒ��� �� �� �ִ�.
������ ���� ����ġ�� �ش� ���丮�� Options
������
FollowSymLinks
��
SymLinksIfOwnerMatch
�� �ִ� ��쿡�� �ɺ���ũ��
����.
��, Alias
���þ�� ���Ͻý����� Ư�� �κ��� �������� �����Ѵ�. ����
��� ������ ���ٸ�
Alias /docs /var/web
URL http://www.example.com/docs/dir/file.html
��
/var/web/dir/file.html
�� ������ �����Ѵ�.
������ ��ο� �ִ� ��� ������ CGI ��ũ��Ʈ�� ����ϴ� ����
�����ϰ��� ScriptAlias
���þ ���� ���� �Ѵ�.
AliasMatch
��
ScriptAliasMatch
���þ��� ������ ����ǥ���ı�� ������ ��ġ�� ����Ͽ� ��
������ ������ �����ϴ�. ���� ���,
ScriptAliasMatch ^/~([a-zA-Z0-9]+)/cgi-bin/(.+)
/home/$1/cgi-bin/$2
�� http://example.com/~user/cgi-bin/script.cgi
����
��û�� ��� /home/user/cgi-bin/script.cgi
��
�����ϰ�, �ش� ������ CGI ��ũ��Ʈ�� ����Ѵ�.
���н� �ý����� ���������� Ư�� ����� user��
Ȩ���丮�� ~user/
�� ��Ī�Ѵ�.
mod_userdir
����� �� ������ ��������
Ȯ���Ͽ�, ������ ���� URL�� ������ �� ����� Ȩ���丮
�ȿ� �ִ� ������ �����Ѵ�.
http://www.example.com/~user/file.html
���Ȼ� ������ ����� Ȩ���丮�� ���� ������ �� ������
�ȵȴ�. ���� UserDir
���þ�� ����� Ȩ���丮���� ���� ���ϵ��� ���� ���丮��
�����Ѵ�. �⺻ ���� Userdir public_html
�� ����ϰ�
/home/user/
�� /etc/passwd
�� ������
����� Ȩ���丮���, ���� URL�� ����
/home/user/public_html/file.html
�� �����Ѵ�.
��, Userdir
���þ�� /etc/passwd
��
Ȩ���丮�� ��ġ�� ��������ʴ� �ý����� ���� ���� �ٸ�
���¸� ����� �� �ִ�.
� ����� (���� ������ %7e
�� ���ڵ��Ǵ�)
"~" ��ȣ�� �̻��Ͽ� �ٸ� ������� ����� ���丮�� ��Ÿ����
�;��Ѵ�. �� ����� mod_userdir�� ���������ʴ´�. ����
����� Ȩ���丮�� ��Ģ���� ������� �������ִٸ�, AliasMatch
���þ ����Ͽ�
���ϴ� ȿ���� ���� �� �ִ�. ���� ���, ������
AliasMatch
���þ ����ϸ�
http://www.example.com/upages/user/file.html
��
/home/user/public_html/file.html
�� �����Ѵ�:
AliasMatch ^/upages/([a-zA-Z0-9]+)/?(.*)
/home/$1/public_html/$2
�տ��� ������ ���� ���þ���� ����ġ�� ���Ͻý����� Ư��
��ҿ� �ִ� ������ Ŭ���̾�Ʈ���� ������ �����. ����
������ ��û�� ������ �ٸ� URL�� �ִٰ� Ŭ���̾�Ʈ���� �˷��־�,
Ŭ���̾�Ʈ�� ���� �� URL�� ��û�ϵ��� ����� ���� ���� ����
�ִ�. �̸� �����̷���(redirection)�̶�� �ϸ�,
Redirect
���þ
����Ѵ�. ���� ���, DocumentRoot
�Ʒ� /foo/
���丮�� ������ ���� /bar/
���丮�� �Ű�ٸ�
������ ���� Ŭ���̾�Ʈ�� ���ο� ��ġ�� ��û�ϵ��� �Ѵ�:
Redirect permanent /foo/
http://www.example.com/bar/
���� www.example.com
������ /foo/
��
�����ϴ� URL-��δ� /foo/
�� /bar/
��
�ٲ� URL�� �����̷��ǵȴ�. Ŭ���̾�Ʈ�� ���� �����ܿ� �
�ٸ� �����ε� �����̷����� �� �ִ�.
��, ����ġ�� �� ������ ���ۼ� ������ ����
RedirectMatch
���þ �����Ѵ�. ���� ���, �ٸ� ��û�� �״�� �ΰ� ����Ʈ
Ȩ�������� ���� ��û���� �ٸ� ����Ʈ�� �����̷����Ϸ���:
RedirectMatch permanent ^/$
http://www.example.com/startpage.html
�ӽ÷� ����Ʈ�� ��� �������� �ٸ� ����Ʈ�� Ư�� �������� �����̷����Ϸ���:
RedirectMatch temp .*
http://othersite.example.com/startpage.html
����ġ�� �ٸ� ������ �ִ� ������ ������ URL �������� ������ �� �ִ�. �� ��� �������� ���� �������� ������ �����ͼ� Ŭ���̾�Ʈ���� �����ϴ� ���Ͻ� ������ ���� �����ϱ���� �̷� ����� �����Ͻ�(reverse proxying)��� �Ѵ�. Ŭ���̾�Ʈ�� ���忡�� �����Ͻ� ������ ������ �����ִ� ��ó�� ���̹Ƿ� �Ϲ� ���Ͻÿʹ� �ٸ���.
�Ʒ� �������� Ŭ���̾�Ʈ�� /foo/
�� �ִ� ������
��û�ϸ�, ������ internal.example.com
��
/bar/
���丮���� ������ �����ͼ� ������ ��ġ
������ �־��� ��ó�� Ŭ���̾�Ʈ���� ������.
ProxyPass /foo/ http://internal.example.com/bar/
ProxyPassReverse /foo/ http://internal.example.com/bar/
ProxyPass
�� ������
������ ������ ���������� �����ϸ�, ProxyPassReverse
���þ��
internal.example.com
�� ������ �����̷����� ���ۼ��Ͽ�
�����̷����� ���� ������ ������ ���丮�� ����Ű���� �Ѵ�.
��, ProxyPassReverseCookieDomain
��
ProxyPassReverseCookieDomain
��
���� ������� ���� ������ ���� ��Ű�� ���ۼ��Ѵ�.
���� ���� �ȿ� �ִ� ��ũ�� ���ۼ����� ������ �����϶�.
internal.example.com
�� ���� ���븵ũ�� Ŭ���̾�Ʈ��
���Ͻü����� �ƴ϶� internal.example.com
���� ����
��û�ϰ� �Ѵ�. �����ڰ� ���� mod_proxy_html
����� ����Ͽ� HTML�� XHTML�� �ִ� ��ũ�� ���ۼ��� �� �ִ�.