<-
Apache > HTTP Server > Documentation > Version 2.0 > ���

Please note

This document refers to the 2.0 version of Apache httpd, which is no longer maintained. Upgrade, and refer to the current version of httpd instead, documented at:

You may follow this link to go to the current version of this document.

����ġ ��� mod_example

������ ���:  en  |  ko 

����:����ġ ��� API�� �����Ѵ�
����:Experimental
����:example_module
�ҽ�����:mod_example.c

���

�� ������ ����ġ ������ 2.0 �������� ����� ������ ��� ���� �ʴ�. ������ ��ȿ�� ������ ������, �����ؼ� ����ϱ� �ٶ���.

����ġ ������ src/modules/example ���丮�� �ִ� ���ϵ��� ����ġ API�� ����Ͽ� ����� �ۼ��Ϸ��� ������� �������� ������.

mod_example.c�� ��� �ݹ�(callback) ������ ȣ�� ������ �����ϴ� �����̴�. ����� ��⿡ �� ��� �ݹ��� ������ �ʿ䰡 ����. ��� ���ݴ��!

example ����� ������ �����ϴ� ����̴�. �� ����� ������ �����ϰ� Ư�� ��ġ�� "example-handler" �ڵ鷯�� �Ҵ��Ͽ� �װ��� ����¡�ϸ� example ����� ���� �ݹ��� Ȯ���� �� �ִ�.

���þ��

����

top

example ��� �������ϱ�

������ example ����� �����Ϸ��� ���� ������ ��ģ��:

  1. src/Configuration ���� �Ʒ� �κп� �ִ� "AddModule modules/example/mod_example" ���� �ּ�ó���� ���ش�. �̷� ���� ���ٸ�, ������ ���� ���� �߰��Ѵ�.

    AddModule modules/example/mod_example.o

  2. src/Configure ��ũ��Ʈ�� �����Ѵ� ("cd src; ./Configure"). �׷��� ���� ��ü Makefile�� �����, �������丮�� �ִ� ��û�� �߰� ����� src/modules/Makefile�� �߰��Ѵ�.
  3. ������ �������Ѵ� (src ���丮�� �ִ� "make"�� �����Ѵ�).

�ڽ��� ���� ����� �߰��Ϸ���:

  1. mkdir src/modules/mymodule
  2. cp src/modules/example/* src/modules/mymodule
  3. ���� ���� ���丮�� �ִ� ������ �����Ѵ�.
  4. ������ �����Ͽ� ���� [1]���� [3]���� ������ �����Ѵ�.
top

mod_example ��� ����ϱ�

example ����� ����Ϸ��� srm.conf ���Ͽ� ������ ���� ������ �߰��϶�:

<Location /example-info>
SetHandler example-handler
</Location>

�ƴϸ� .htaccess ���Ͽ� ������ ���� ������ �߰��ϰ�, �� ��ġ���� "test.example" ���� ������ ��û�϶�:

AddHandler example-handler .example

������ ������� �� �� ��ġ�� ����¡�ϸ� �տ��� ���� ������ ���Ե� ���̴�.

top

Example ���þ�

����:����ġ ��� API�� �����ϱ����� ���� ���þ�
����:Example
������:�ּ�������, ����ȣ��Ʈ, directory, .htaccess
����:Experimental
���:mod_example

Example ���þ�� example ����� �����ڵ鷯�� ������ ������ ������ ���θ� �����Ѵ�. �� ���þ�� �ƱԸ�Ʈ�� �����ʴ´�. example �����ڵ鷯�� ������ URL�� �����ϸ� ���� ��û�� �����ϱ����� ���ȿ� �Լ����� ��� �׸��� � ������ �Ҹ����� �� �� �ִ�. �� ���þ��� ȿ���� "Example directive declared here: YES/NO"�� Ȯ���� �� �ִ�.

������ ���:  en  |  ko