I have a default Apache installation on Ubuntu 10.04.
I use the following Nmap scan to determine the available Apache methods:
nmap -p80 --script=http-methods 192.168.1.66
The result is:
http-methods: GET HEAD POST OPTIONS
I'm trying to eliminate the HEAD method. So in /etc/apache2/apache.conf
I added the following:
<Directory "/var/www/*">
<LimitExcept GET POST OPTIONS>
Deny from all
</LimitExcept>
...
</Directory>
I then restarted the web server. However the nmap scan still prints the same results.
Does anyone know what I'm missing here?
The documentation for
<Limit>
explicitly states:This very strongly implies that for the purposes of
<Limit>
and<LimitExcept>
thatGET
andHEAD
are treated the same. Restrictions applied toGET
will apply toHEAD
, and therefore ifGET
is unrestricted soHEAD
will also be unrestricted.Further, the
HTTP/1.1
RFC 2616
explicitly states (section 9.4):Further clarifying the direct relationship between
GET
andHEAD
.The final piece of information to clarify this, also from
RFC 2616
, (section 5.1.1):This information all together tends to strongly imply that what you wish to accomplish will not be possible by configuration changes alone.