Ubuntu – Enable all HTTP methods on Apache

14.04Apache2configurationserver

I have set up a completely plain Apache web server (version 2.4.7) on Ubuntu Server 14.04.1 LTS.

I want to enable other HTTP methods such as PUT and DELETE for some testing purposes. I edited my /etc/apache2/apache2.conf file and added the directive

<Location />
   <LimitExcept GET HEAD POST OPTIONS DELETE PUT>
       Allow from all
   </LimitExcept>
</Location>

before restarting Apache.

However, if I use Telnet and type OPTIONS / HTTP/1.0 I do only get Allow: GET,HEAD,POST,OPTIONS back, and not the methods I wanted such as PUT. What should I do to enable these methods?

Best Answer

PUT and DELETE methods are enabled by default and are only usable with handlers.

Example

> a2enmod actions ; service apache2 reload

<Location />
 Script PUT /handler.php
 Script DELETE /handler.php
</Location>
Related Question