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

����ġ ��� mod_ext_filter

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

�� ������ �ֽ��� ������ �ƴմϴ�. �ֱٿ� ����� ������ ���� ������ �����ϼ���.
����:���� ������ �ܺ� ���α׷����� ó���� �� Ŭ���̾�Ʈ�� ������
����:Extension
����:ext_filter_module
�ҽ�����:mod_ext_filter.c

���

mod_ext_filter�� ����ϸ� �����ϰ� �ͼ��� ������� ������ ���� �� �ִ�. ǥ���Է¿��� �а� ǥ����¿� ���� ���α׷�(��, ���н��� ���� ���ɾ�)�� ����ġ ���ͷ� ����� �� �ִ�. �̷� ���ʹ� ����ġ API�� �������� ����ġ ���� ���μ��� �ȿ��� ����Ǵ� ���Ϳ� ���� �ſ� ��������, ������ ���� ������ �ִ�:

���� ����ϱ⿡�� ������ ����������, mod_ext_filter�� ����Ͽ� ���͸� ���� ���� �� �ִ�.

���þ��

����

����

top

����

�ٸ� type�� ������ HTML�� �����

# mod_ext_filter ���þ ������
# �ܺ� ���α׷� /usr/bin/enscript�� ����Ͽ�
# �������ϰ� text/c ������ HTML�� ����� �����
# type�� text/html�� �����ϴ� ���͸� �����Ѵ�
ExtFilterDefine c-to-html mode=output \
intype=text/c outtype=text/html \
cmd="/usr/bin/enscript --color -W html -Ec -o - -"

<Directory "/export/home/trawick/apacheinst/htdocs/c">
# ��¿� ���ο� ���͸� �����ϴ� core ���þ�
SetOutputFilter c-to-html

# .c ������ type�� text/c�� ����� mod_mime
# ���þ�
AddType text/c .c

# ����� ������ ������ ��û���� ���� ������
# �˷��ִ� �α׹��� ����ϴ� mod_ext_filter
# ���þ�
ExtFilterOptions DebugLevel=1
</Directory>

content ���ڵ� ���� �����ϱ�

Note: �Ʒ� gzip ������ ���� ������ ���� �� ���̴�. ���� ���񽺿� ����Ϸ��� mod_deflate�� �����ϱ� �ٶ���.

# �ܺ� ���͸� �����ϴ� mod_ext_filter ���þ�
ExtFilterDefine gzip mode=output cmd=/bin/gzip

<Location /gzipped>
# ����Ҷ� gzip ���͸� �����ϴ� core ���þ�
SetOutputFilter gzip

# "Content-Encoding: gzip" ����� �߰��ϴ�
# mod_header ���þ�
Header set Content-Encoding gzip
</Location>

������ ������ �ϱ�

# cat���� ��� ������ ����ϴ� ���͸� �����ϴ�
# mod_ext_filter ���þ�; cat�� �ƹ��͵� ��������
# �ʴ´�; ���� ó����θ� ��� �Ͽ� �ڿ��� �� �Ҹ��Ѵ�
ExtFilterDefine slowdown mode=output cmd=/bin/cat \
preservescontentlength

<Location />
# ����Ҷ� slowdown ���͸� ������ �����ϴ� core ���þ�
#
SetOutputFilter slowdown;slowdown;slowdown
</Location>

sed�� ����Ͽ� ���信�� ���� ��ü�ϱ�

# ���信�� ���� ��ü�ϴ� ���͸� �����ϴ�
# mod_ext_filter ���þ�
#
ExtFilterDefine fixtext mode=output intype=text/html \
cmd="/bin/sed s/verdana/arial/g"

<Location />
# ����Ҷ� fixtext ���͸� �����ϴ� core ���þ�
SetOutputFilter fixtext
</Location>

�ٸ� ���͸� �����ϱ�

# ���� ������ �ִ� Ư�� Ŭ���̾�Ʈ(IP 192.168.1.31)��
# ���� mod_deflate�� �а� ���� �ڷḦ �����Ѵ�.
# �� ���ʹ� mod_deflate�� ������ �� �ڷḦ �����Ѵ�.
ExtFilterDefine tracebefore \
cmd="/bin/tracefilter.pl /tmp/tracebefore" \
EnableEnv=trace_this_client

# �� ���ʹ� mod_deflate���� ������ �ڷḦ �����Ѵ�.
# ftype �Ķ���͸� ��������ʴ� ���, �⺻ ������
# AP_FTYPE_RESOURCE�� ���� ������ mod_deflate *������*
# �д�. AP_FTYPE_CONTENT_SET ���� ���� ���� ���ڰ���
# �����ϸ� mod_deflate ���Ŀ� �����Ѵ�.
ExtFilterDefine traceafter \
cmd="/bin/tracefilter.pl /tmp/traceafter" \
EnableEnv=trace_this_client ftype=21

<Directory /usr/local/docs>
SetEnvIf Remote_Addr 192.168.1.31 trace_this_client
SetOutputFilter tracebefore;deflate;traceafter
</Directory>

������ �ڷḦ �����ϴ� �����̴�:

#!/usr/local/bin/perl -w
use strict;

open(SAVE, ">$ARGV[0]")
or die "can't open $ARGV[0]: $?";

while (<STDIN>) {
print SAVE $_;
print $_;
}

close(SAVE);

top

ExtFilterDefine ���þ�

����:�ܺ� ���͸� �����Ѵ�
����:ExtFilterDefine filtername parameters
������:�ּ�������
����:Extension
���:mod_ext_filter

ExtFilterDefine ���þ�� �ܺ� ������ ������ ������ ���α׷�, �ƱԸ�Ʈ�� �����Ѵ�.

filtername�� ������ ���� �̸��� �����Ѵ�. �� �̸��� SetOutputFilter ���þ�� ����Ѵ�. ����� ��� ���͵鰣�� �̸��� ��ġ�� �ȵȴ�. ���� ���͵�� API�� ������ �������� �ʴ´�. �׷��� ����ڴ� �̸��� ��ġ�� ������ ���� ���Ѵ�.

������ �ܺ� ���ɾ�� �ٸ� ������ �����ϴ� ������ �ƱԸ�Ʈ�� � ������ ���͵� �����ϴ�. ��, cmd= �Ķ���ʹ� �ݵ�� �ʿ��ϴ�. ����� �� �ִ� �Ķ���ʹ� ������ ����:

cmd=cmdline
cmd= Ű����� ������ �ܺ� ���ɾ �����Ѵ�. ���α׷��� �ڿ� �ƱԸ�Ʈ�� �ִٸ� �������� �ֵ���ǥ�� ����� �Ѵ� (���� ���, cmd="/bin/mypgm arg1 arg2"). ���� ��ġ���ʰ� ���� ���α׷��� �����ϱ⶧���� �Ϲ����� �� ����ǥ�� �ʿ����. ���α׷� �ƱԸ�Ʈ���� �������� �����Ѵ�. ���α׷� �ƱԸ�Ʈ�� ������ �ִٸ� ���� �տ� �齽������ ����ؾ� �Ѵ�. �齽������ �ƱԸ�Ʈ�� �Ϻζ�� �齽������ �ι� ����ؾ� �Ѵ�. ���α׷��� �����Ҷ� ǥ�� CGI ȯ�溯���� �߰��� DOCUMENT_URI, DOCUMENT_PATH_INFO, QUERY_STRING_UNESCAPED ������ �����Ѵ�.
mode=mode
������ ó���ϴ� ���ʹ� (�⺻����) mode=output�� ����Ѵ�. ��û�� ó���ϴ� ���ʹ� mode=input�� ����Ѵ�. mode=input�� ����ġ 2.1�� �߰��Ǿ���.
intype=imt
�� �Ķ���ʹ� ���ͷ� ó���� ������ ���ͳ� media type(��, MIME type)�� �����Ѵ�. �⺻������ ��� ������ ���ͷ� ó���Ѵ�. intype=�� �����ϸ� �ٸ� type�� ������ ���ͷ� ó������ �ʴ´�.
outtype=imt
�� �Ķ���ʹ� ���ͷ� ó���� ������ ���ͳ� media type(��, MIME type)�� �����Ѵ�. ����ó�� �۾��߿� ���ͳ� media type�� �����Ҷ� �����ϴ�. �⺻������, ���ͳ� media type�� ������ �ʴ´�.
PreservesContentLength
PreservesContentLength Ű����� ���Ͱ� content length�� �����ϵ��� �Ѵ�. ��κ��� ���Ͱ� content length�� �����ϹǷ� �� Ű����� �⺻���� �ƴϴ�. ���Ͱ� ���̸� �����Ҷ��� �� Ű���带 ����ؾ� �Ѵ�.
ftype=filtertype
�� �Ķ���ʹ� ���� ������ ���� ���ڰ��� �����Ѵ�. ��κ��� ��� �⺻���� AP_FTYPE_RESOURCE�� �����ϴ�. ���͸� �����ϴ� ������ �ڿ����Ϳ� �޶���ϴ� ��� �� �Ķ���Ͱ� �ʿ��ϴ�. ������ ���� �˷��� util_filter.h�� �ִ� AP_FTYPE_* ���Ǹ� �����϶�.
disableenv=env
�� �Ķ���ͷ� ������ ȯ�溯���� ���ǵǾ��ٸ� ���͸� ������� �ʴ´�.
enableenv=env
�� �Ķ���ͷ� ������ ȯ�溯���� ���ǵ� ��� ���͸� ����Ѵ�.
top

ExtFilterOptions ���þ�

����:mod_ext_filter �ɼ��� �����Ѵ�
����:ExtFilterOptions option [option] ...
�⺻��:ExtFilterOptions DebugLevel=0 NoLogStderr
������:directory
����:Extension
���:mod_ext_filter

ExtFilterOptions ���þ�� mod_ext_filter�� Ư���� ó���ɼ��� �����Ѵ�. Option�� ������ �ϳ���.

DebugLevel=n
DebugLevel Ű����� mod_ext_filter�� ����ϴ� ����� ���� ������ ���Ѵ�. �⺻���� ����׹��� ������� �ʴ´�. �̴� DebugLevel=0�� ����. ���� ���ڸ� ����Ҽ���, �� ���� ����׹��� ��ϵǰ� ���� ������ ��������. ���ڰ��� ���� �ǹ̴� mod_ext_filter.c �պκп� �ִ� DBGLVL_ ��� ���ǿ� �������ִ�.

����: ���� �α׸� ����Ϸ��� core ���þ� LogLevel�� ����Ͽ� ����׹��� ����ġ �����α׿� ����ؾ� �Ѵ�.

LogStderr | NoLogStderr
LogStderr Ű����� �ܺ� ���� ���α׷��� ǥ�ؿ����� ����ϴ� ������ ����ġ �����α׿� ����Ѵ�. NoLogStderr�� �� ����� ���� �ʴ´�.

����

ExtFilterOptions LogStderr DebugLevel=0

���� ������ ����ϸ� ���Ͱ� ǥ�ؿ����� ����ϴ� ������ ����ġ �����α׿� ����ϰ�, mod_ext_filter�� ��ü ����׹��� ������� �ʴ´�.

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

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.