<-
Apache > HTTP Server > Documentation > Version 2.4

����������ü (DSO) ����

������ ���:  en  |  fr  |  ja  |  ko  |  tr 

�� ������ �ֽ��� ������ �ƴմϴ�. �ֱٿ� ����� ������ ���� ������ �����ϼ���.

����ġ �������� �����ڰ� ������ �����Ͽ� ������ ������ ����� ������ �� �ִ� ���ȭ�� ���α׷��̴�. ������ �����Ҷ� httpd �������Ͽ� �������� ����� �������� �� �ִ�. �ƴϸ� ����� httpd �������ϰ� �и��Ͽ� ����������ü(Dynamic Shared Objects, DSO)�� �������� �� �ִ�. DSO ����� ������ �������Ҷ� �������ϰų�, Apache Extension Tool (apxs)�� ����Ͽ� ���߿� �������Ͽ� �߰��� �� �ִ�.

�� ������ DSO ��� ������ ��� �̷��� �����Ѵ�.

Support Apache!

����

top

����

����ġ �ٽɿ� �������� �������ؾ��� mod_so.c��� ����� ����ġ ����� �о���̱����� DSO�� �����Ѵ�. �� ����� core�� �����ϰ� DSO�� �� �� ���� ������ ����̴�. ������ �ٸ� ��� ����ġ ����� ��ġ �������� ������ configure�� --enable-module=shared �ɼ��� ����Ͽ� DSO�� �������� �� �ִ�. ����� mod_foo.so�� ���� DSO�� ���������� apache2.conf ���Ͽ� mod_so�� LoadModule ���ɾ ����Ͽ� ���� ���۽� Ȥ�� ����۽� �� ����� �о���� �� �ִ�.

����ġ ���(Ư�� �����ڰ� ���� ���)�� ����� DSO ������ ���� ��������� apxs (APache eXtenSion)��� ���ο� ���� ���α׷��� �ִ�. �� ���α׷��� ����ġ �ҽ� Ʈ�� �ۿ��� DSO�� ����� ����� �������Ҷ� ����Ѵ�. ������ ����. ����ġ�� ��ġ�Ҷ� configure�� make install�� ����ġ C ��������� ��ġ�ϰ�, DSO ������ �������ϱ����� �÷��� Ư���� �����Ϸ� �ɼǰ� ��Ŀ �ɼ��� apxs ���α׷��� ����Ѵ�. �׷��� apxs�� ����ϴ� ����ڴ� ����ġ ������ �ҽ� Ʈ������, �� DSO ������ ���� �÷��� Ư���� �����Ϸ� �ɼǿ� ��Ŀ �ɼǿ� �Ű��� �����ʰ� �ڽ��� ����ġ ��� �ҽ��� �������� �� �ִ�.

top

���� ���

Apache 2.2�� DSO ��ɿ� ���� ª�� ������ ����̴�:

  1. �������� �ִ� ����ġ ����� �������ϰ� ��ġ�ϴ� ���. ���� ��� mod_foo.c�� DSO mod_foo.so��:

    $ ./configure --prefix=/path/to/install --enable-foo=shared
    $ make install

  2. �����ڰ� ���� ����ġ ����� �������ϰ� ��ġ�ϴ� ���. ���� ��� mod_foo.c�� DSO mod_foo.so��:

    $ ./configure --add-module=module_type:/path/to/3rdparty/mod_foo.c --enable-foo=shared
    $ make install

  3. ���� ����� ���߿� ����ϱ����� ����ġ�� �����ϴ� ���:

    $ ./configure --enable-so
    $ make install

  4. �����ڰ� ���� ����ġ ����� �������ϰ� ��ġ�ϴ� ���. apxs�� ����Ͽ� ����ġ �ҽ� Ʈ�� �ۿ��� mod_foo.c�� DSO mod_foo.so��:

    $ cd /path/to/3rdparty
    $ apxs -c mod_foo.c
    $ apxs -i -a -n foo mod_foo.la

��� ��� �ϴ� ���� ����� �����ϵǸ�, apache2.conf�� LoadModule ���þ ����Ͽ� ����ġ�� �� ����� �о���̰� �����.

top

�������

�������� ���н������� ����������ü (DSO)�� ���� ��ŷ/�ε�(dynamic linking/loading)�̶�� �Ͽ�, Ư���� ������ �����ڵ� ������ ����� �������� �������α׷��� �ּҰ����� �о���̴� ���� ����� �ִ�.

���� �ΰ��� ������� �о���� �� �ִ�. �ϳ��� �������α׷��� �����Ҷ� ld.so��� �ý��� ���α׷��� �ڵ����� �о���̴� ����, �ٸ� �ϳ��� �������� ���α׷��� dlopen()/dlsym() �ý���ȣ��� ���н� �δ�(loader)�� �ý��� �������̽��� ����Ͽ� ���� �о���̴� ����.

ù��° ��� DSO�� ���� �������̺귯��(shared libraries) Ȥ�� DSO ���̺귯����� �θ���, ������ libfoo.so�� libfoo.so.1.2 ���� �̸��� ������. �̵��� �ý��� ���丮(���� /usr/lib)�� �ְ�, �����Ͻ� ��Ŀ ���ɾ -lfoo�� �־� �������ϰ� �����Ѵ�. �̷��� ���� ���� ���̺귯���� �������Ͽ� �����ǿ���, ���α׷��� �����Ҷ� ��Ŀ �ɼ� -R�� ���� ������ ���, ȯ�溯�� LD_LIBRARY_PATH�� ������ ��� Ȥ�� /usr/lib���� ���н� �δ��� libfoo.so�� ã�� �� �ִ�. �׷��� �������α׷��� (���� ��ã��(unresolved)) �ɺ�(symbol)�� DSO���� ã�Եȴ�.

DSO�� ���� �������α׷��� �ɺ��� ã���ʱ� ������ (DSO�� ���밡���� �Ϲ����� �ڵ� ���̺귯���̹Ƿ�) ã��� ���⼭ ������. ���н� �δ��� �ɺ� ã�⸦ ������ ����ϹǷ� �������α׷��� ���� DSO���� �ɺ��� ã�� �ʿ䰡 ����. (��� ld.so�� �θ��� �ڵ�� ������ �ƴ� ��� �������α׷��� ��ũ�Ǵ� ����� �����ڵ��� �Ϻδ�.) ����� ���̺귯�� �ڵ带 �������� �о���̴� ������ ��Ȯ�ϴ�. ���̺귯�� �ڵ尡 ��� ���α׷��� �ߺ��ؼ� ����Ǵ� ��� libc.so�� ���� �ý��� ���̺귯���� �ѹ��� ����DZ� ������ ��ũ ������ ����ȴ�.

�ι�° ��� DSO�� ���� ������ü(shared objects) Ȥ�� DSO �����̶�� �θ���, (��Ģ�� �̸��� foo.so������) ������ Ȯ���ڴ� �����Ӵ�. �� ���ϵ��� ���� ���α׷� ��ü ���丮�� ��ġ�ϰ� �������α׷��� �ڵ����� ������� �ʴ´�. ��� �������α׷��� ����� dlopen()�� ����Ͽ� DSO�� �ּҰ����� ���� �о�鿩�� �Ѵ�. �̶� �������α׷��� DSO���� �ɺ��� ã�� �ʴ´�. ��� �տ��� �� ���н� �δ��� �ڵ����� �������ϰ� ���������� �̹� �о���� DSO ���̺귯��(Ư�� �׻� �����ϴ� libc.so�� ��� �ɺ�)���� DSO�� (���� ��ã��) �ɺ��� ã�´�. �׷��� DSO�� ��ġ ó������ �������α׷��� �������� ��ũ�ȰͰ� ���� ���������� �ɺ��� �˰Եȴ�.

DSO�� API�� �̿��ϱ����ؼ� ���������� �������α׷��� dlsym()���� DSO���� Ư�� �ɺ��� ã�Ƽ�, ������ ����ϱ����� ����ġ(dispatch) ǥ ���� �����Ѵ�. �ٸ� ���� �������α׷��� ����� ��� �Ǻ��� ���� ã�ƾ��Ѵ�. �̷� ������ ������ ���α׷��� �Ϻθ� ���α׷��� �ʿ��Ҷ����� �о������ �ʾƵ� (�׷��� �޸𸮸� �������� �ʰ�) �ȴٴ� ���̴�. �⺻ ���α׷��� ����� Ȯ���ϱ����� �ʿ��� ��� �� �κ��� �������� �о���� �� �ִ�.

�̷� DSO ������ �ڿ������� ��������, �ּ��� ����� ���� �Ѱ����ִ�. ���α׷��� Ȯ���ϱ����� DSO�� ����Ҷ� DSO�� �������α׷��� �ɺ��� ã�� ���̴�. ��? DSO�� �������α׷��� �ɺ��� "������ ã�� ��"�� (���̺귯���� �ڽ��� ����ϴ� ���α׷��� ���� �𸥴ٴ�) ���̺귯�� ���迡 ���ϸ�, ��� �÷������� ���������ʰ� ǥ��ȭ������ �ʾұ� �����̴�. ������ ���������� �����ɺ�(global symbol)�� ���� �ͽ���Ʈ(export)���� �ʱ⶧���� DSO�� ����� �� ����. DSO�� ����Ͽ� ������ ���α׷��� Ȯ���Ϸ��� ��Ŀ���� ��� �����ɺ��� �ͽ���Ʈ�ϵ��� �����ϴ� ���� �ֵ� �ذ�å�̴�.

�������̺귯���� DSO ����� �����Ģ��� �������̱⶧���� �ü���� �����ϴ� ���� ��� ������ ���̺귯���� ����Ѵ�. �ݴ�� ���� ���α׷��� ���α׷��� Ȯ���ϱ����� ������ü�� ������� �ʴ´�.

1998�� ������ ������ ����� Ȯ���ϱ����� DSO ������ ����� ����Ʈ���� ��Ű���� (XS ������ DynaLoader ����� �����) Perl 5, Netscape Server ������ �幰����. ����ġ�� �̹� ����� Ȯ���ϱ����� ��� ������ ����߰� �ܺ� ����� ����ġ �ٽɱ�ɿ� �����ϱ����� ���������� ����ġ����� �̿��� ���ٹ���� ����߱⶧���� 1.3 �������� �� �뿭�� �շ��ߴ�. �׷��� ����ġ�� ������ ����� �о���̴µ� DSO�� ����ϵ��� �����������.

top

�����

�տ��� ���� DSO�� ����ϸ� ������ ���� ������ �ִ�:

DSO�� ������ ���� ������ �ִ�:

������ ���:  en  |  fr  |  ja  |  ko  |  tr 

top

Comments

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.