How to enable all HTTP methods in an Apache HTTP Server
Solution 1:
Apache implements all relevant HTTP methods for static content (actual files served directly by Apache). For dynamic content (CGI scripts, mod_php
, etc), Apache does not care what the HTTP method is (unless it is explicitly restricted with a <Limit>
directive), and passes the request to the appropriate handler as it is. Your script needs to handle the specific method as intended, not Apache. Even non-standard methods are passed to dynamic handlers with no problem.
Tested with an invalid ASDFG / HTTP/1.1
request handled by a mod_php
script. No complaint from Apache, received ASDFG
in $_SERVER['REQUEST_METHOD']
in the handler script.
Solution 2:
based on http://httpd.apache.org/docs/current/mod/core.html , these methods can be modified in the directory
and .htaccess
configuration files using the Limit method [method] ... > ... </Limit>
directive
Basically you have to comment out options like the ones below which are used to block the methods.
<Limit POST PUT DELETE>
Require valid-user
</Limit>