AH01623 [allowmethods:error] Issue on DirectAdmin & How to Fix it

 This post is for my personal reference for future use.

If you are using a VPS or a Dedicated Server and installed DirectAdmin as a Web / Server Panel, sometimes you may encounter the following error:

Sat May 02 07:27:45.728967 2020] [allowmethods:error] [pid 20266:tid XXXXXXX848] [client XXXXXXX] AH01623: client method denied by server configuration: 'PATCH' to /home/XXXXX/domains/XXXXXXX, referer: https://XXXXXXXX

This means that the server does not support a specific Request Method which in my case is a PATCH Request Method. So in order for this PATCH Request Method to work on the server that is using DirectAdmin, we need to enable it by:

  1. SSH to your server
  2. Type the following commands

cd /usr/local/directadmin/custombuild
./build set http_methods GET:HEAD:POST:PUT:DELETE:PATCH:OPTIONS
./build rewrite_confs

Fix:

This is due to your file server blocking the OPTIONS http method. You will need to allow this method within your Apache configuration and ensure you have nothing like mod_security blocking this method.

For Apache on DirectAdmin:

nano /usr/local/directadmin/data/users/cdn1/httpd.conf

Add the following to the vhost, directory section:

AllowMethods GET HEAD POST OPTIONS DELETE PUT

Restart Apache after these changes.

Example:

<VirtualHost 1.1.1.1:80 >
<Directory /home/cdn1/domains/yoursite.com/public_html>
AllowOverride AuthConfig FileInfo Indexes Limit Options=Indexes,IncludesNOEXEC,MultiViews,SymLinksIfOwnerMatch,FollowSymLinks,None
Options -ExecCGI -Includes +IncludesNOEXEC
AllowMethods GET HEAD POST OPTIONS DELETE PUT
</Directory>
</VirtualHost>

Comments

Popular posts from this blog

cpanel exam CPSP Answers

How to install zimbra collaboration suite 8.8.11 on CentOS 7

awstats installation