
AddOutputFilterByType 설정은 Apache 서버에서 특정 파일 유형에 대한 필터를 설정하는 방법으로 사용됩니다.
이 설정에서 order를 지정하지 않으면 오류가 발생하는 이유는 Apache 서버가 여러 필터를 적용할 때, 필터의 순서가 정의되지 않아 필터가 충돌하거나 중복 적용되는 경우가 발생할 수 있기 때문입니다.
order를 지정하는 방법은 다음과 같습니다.
1. AddOutputFilterByType 설정에서 order를 지정할 필터 이름을 명시적으로 지정합니다.
예를 들어, mod_security와 mod_rewrite를 함께 사용할 때, order를 지정할 필터 이름을 다음과 같이 지정할 수 있습니다.
SetHandler application/x-httpd-php
AddOutputFilterByType text/html mod_security
AddOutputFilterByType text/html mod_rewrite
2. AddOutputFilterByType 설정에서 order를 지정할 필터 이름을 명시적으로 지정하지 않으면, Apache 서버는 기본적으로 mod_security가 먼저 적용되고, 그 다음 mod_rewrite가 적용됩니다.
SetHandler application/x-httpd-php
AddOutputFilterByType text/html mod_security
AddOutputFilterByType text/html mod_rewrite
3. order를 지정할 필터 이름을 명시적으로 지정하지 않으면, Apache 서버는 mod_security가 먼저 적용되고, 그 다음 mod_rewrite가 적용됩니다.
SetHandler application/x-httpd-php
AddOutputFilterByType text/html mod_security
AddOutputFilterByType text/html mod_rewrite
위의 예제에서 mod_security가 먼저 적용되고, 그 다음 mod_rewrite가 적용되는 이유는 mod_security가 mod_rewrite보다 먼저 적용되는 순서를 지정했기 때문입니다.
따라서, AddOutputFilterByType 설정에서 order를 지정하지 않으면 오류가 발생하는 것을 방지하기 위해, order를 지정할 필터 이름을 명시적으로 지정하거나, Apache 서버의 기본 순서를 사용할 수 있습니다.
2025-06-30 04:18