Apache Web Server를 사용하면서 HTTP Method 중 특정 method만 제한을 걸고 싶은 경우가 있다.

apache 버전의 경우 서버단으로 제한을 걸수는 없고 디렉토리 별로 제한을 걸 수 있다.

method 제한을 거는 경우 에는 아래 처럼 설정하면은 된다.

<Directory /home>
    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit OPTIONS PROPFIND>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>
위와 같이 설정을 하면은 GET, POST 이외의 method로 접속하는 경우에는 405 Method Not Allowed 에러를 발생을 한다.
저작자 표시 비영리 동일 조건 변경 허락
크리에이티브 커먼즈 라이선스
Creative Commons License
Posted by Rey