onde adicionar código para desabilitar o método OPTIONS no apache

0

uma avaliação de segurança de aplicativos da web recomenda que eu use disable OPTIONS method on the webserver

estou rodando o Apache / 2.2.22 (ubuntu)

A solução que encontrei até agora foi adicionar esse código.

RewriteEngine on
RewriteCond %{THE_REQUEST} !^(POST|GET)\ /.*\ HTTP/1\.1$
RewriteRule .* - [F]

estou bastante confuso onde adicionar este código específico, eu tenho 3 .conf no meu /etc/apache2

  • apache2.conf
  • link
  • ports.conf

eu adiciono o snippet em qualquer lugar dentro do arquivo .conf ?

[editar]

depois de adicionar a configuração no meu apache2.conf OR httpd.conf im recebendo este erro quando tento reiniciar

Invalid command 'RewriteCond', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.

The Apache error log may have more information.
   ...fail!

[edit2]

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://192.168.5.1/web/">here</a>.</p>
<hr>
<address>Apache/2.2.22 (Ubuntu) Server at 192.168.5.1 Port 80</address>
</body></html>
    
por user1666411 12.12.2013 / 07:42

1 resposta

0

Se você tiver configurado o vhosts para o seu site, poderá adicionar o vhosts desejado. Se não, você pode simplesmente adicionar ao httpd.conf , se não existir, adicionar ao arquivo apache2.conf .

    
por Rahil Wazir 12.12.2013 / 07:54