Why there is no <location>
in my Apache2 config file?
$ sudo nano /etc/apache2/apache2.conf
I can find the <Directory />
as follows:
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
But i cannot find at all. I am trying to allow OPTIONS DELETE PUT methods as follows:
<Location "/">
AllowMethods GET POST OPTIONS DELETE PUT
Require all granted
</Location>
My Apache version:
$ apache2 -v
Server version: Apache/2.4.38 (Ubuntu)
Server built: 2019-08-26T13:31:40
Any ideas how to add AllowMethods GET POST OPTIONS DELETE PUT
?
Because the
<Location>
directives are appropriate for specific needs (rules) and such rules are not appropriate for any default configuration :)<Location>
DirectiveThe
<Directory />
directive refers to the root/
of the filesystem. In other hand<Location />
refers to the base URI -http://example.com
/
, whereexample.com
is theServerName
of a virtual host. So the rules written for<Location />
will override the rules written for<Directory /var/www/html>
, where/var/www/html
is theDocumentRoot
of the particular virtual host.