Apache allowed methods : Delete

ssgill

Verified User
Joined
May 9, 2012
Messages
164
Hello, I am trying to add "DELETE" method in apache allowed methods. Followed this KB : https://help.directadmin.com/item.php?id=700 and checked the forum for relevant post's but have not have found any definite solution.
There is only one httpd-directories.conf, checked custom folder and locate also only lists 1 file. Permissions on file are as follow, one odd thing is httpd-directories.conf symlinks to httpd-directories-old.conf and there is another file httpd-directories-new.conf in the extra folder. Is this standard ..

Code:
lrwxrwxrwx 1 root root  26 Oct  3  2019 /etc/httpd/conf/extra/httpd-directories.conf -> httpd-directories-old.conf
-rw-r--r-- 1 root root 503 Oct  3  2019 /etc/httpd/conf/extra/httpd-directories-new.conf
-rw-r--r-- 1 root root 366 Jun 25 09:59 /etc/httpd/conf/extra/httpd-directories-old.conf

Code:
cat /etc/httpd/conf/extra/httpd-directories.conf
<Directory />
    Options All
    AllowOverride All
</Directory>

<Directory /home>
    AllowOverride All
    Options -MultiViews -Indexes +FollowSymLinks +IncludesNoExec +Includes
    AllowMethods GET HEAD POST DELETE
</Directory>

Include /etc/httpd/conf/extra/httpd-hostname.conf

<Directory /var/www/cgi-bin>
    AllowOverride None
    Options None
    Require all granted
</Directory>
Code:
/etc/httpd/conf/extra/httpd-directories-old.conf
<Directory />
    Options All
    AllowOverride All
</Directory>

<Directory /home>
    AllowOverride All
    Options -MultiViews -Indexes +FollowSymLinks +IncludesNoExec +Includes
    AllowMethods GET HEAD POST
</Directory>

Include /etc/httpd/conf/extra/httpd-hostname.conf

<Directory /var/www/cgi-bin>
    AllowOverride None
    Options None
    Require all granted
</Directory>
Code:
cat /etc/httpd/conf/extra/httpd-directories-new.conf
<Directory />
    Options SymLinksIfOwnerMatch
    AllowOverride None

    Require all denied
</Directory>

<Directory /home>
    AllowOverride AuthConfig FileInfo Indexes Limit Options=Includes,IncludesNOEXEC,Indexes,ExecCGI,MultiViews,SymLinksIfOwnerMatch,None
    Options IncludesNoExec Includes SymLinksIfOwnerMatch ExecCGI
    AllowMethods GET HEAD POST
</Directory>

Include /etc/httpd/conf/extra/httpd-hostname.conf

<Directory /var/www/cgi-bin>
    AllowOverride None
    Options None
    Require all granted
</Directory>

Any help would be appreciated. Thanks
 
Why aren't you just setting it in the options.conf ?


And it already seems to be enabled.

Thanks for reply. My options.con does have this enabled
http_methods=GET:HEAD:POST:PUT:DELETE


I manually added Delete in httpd-directories.conf and delete method works, but that will be overwritten and instructions from KB are not getting desired results. I did a test to see if steps from KB are updating the httpd-directories.con file

Added Delete in httpd-directories.con file

Code:
[root@matrix custombuild]# ./build set http_methods GET:HEAD:POST:PUT:DELETE
Changed http_methods option from GET:HEAD:POST:PUT:DELETE to GET:HEAD:POST:PUT:DELETE
[root@matrix custombuild]# ./build rewrite_confs
apache webserver does not support 'modern' ssl_configuration option due to lack of support of TLSv1.3 in OpenSSL package on CentOS/RHEL/CloudLinux 7.
[root@matrix custombuild]# cat /etc/httpd/conf/extra/httpd-directories.conf
<Directory />
    Options All
    AllowOverride All
</Directory>

<Directory /home>
    AllowOverride All
    Options -MultiViews -Indexes +FollowSymLinks +IncludesNoExec +Includes
    AllowMethods GET HEAD POST DELETE
</Directory>

Include /etc/httpd/conf/extra/httpd-hostname.conf

<Directory /var/www/cgi-bin>
    AllowOverride None
    Options None
    Require all granted
</Directory>
This time delete is there, so i removed delete from file and did the steps again and there is no delete method in file. Looks like httpd-directories.con is not being updated. This error message on rewrite is it just a message or should i take some steps to fix it.

Thanks

System: CentOS Linux release 7.8.2003 (Core)
Directadmin: 1.61.3
 
Last edited:
Code:
ls /usr/local/directadmin/custombuild/custom/ap2/conf/extra
 
[root@matrix custombuild]# ls /usr/local/directadmin/custombuild/custom/ap2/conf/extra
httpd-ssl.conf
 
Back
Top