Page 1 of 1

Http request methods - apache2

Posted: Tue Apr 09, 2019 6:25 am
by pht
Hi Guys

First of all I want tell you something about Vesta - it works awesome.

But...

I use VestaCP for couple years and now I have a little problem. My client wants to use his own api. He need a "GET, POST, PUT, DELETE, HEAD" HTTP requests methods. I tried many solutions to set these options but they change nothing. I'm very frustrated by this. Does somebody know where in VestaCP configs this methods are blocked (PUT, POST should be power on off default) and can tell me what I can do to fix my problem.

Apache version: Apache/2.4.25(debian)
PHP Version 7.0.33-0+deb9u3
OS: Debian 9
phpinfo() - http://new.malawishop.pl/info.php

PS. I read on this forum another thread - viewtopic.php?t=7258 I tried manipulated settings but still nothing

Re: Http request methods - apache2

Posted: Wed Apr 10, 2019 8:24 pm
by dreiggy
Try create custom httpd include for domain:

/home/$USER/conf/web/httpd.$DOMAIN.TLD.conf-allowmethods

Code: Select all

<Directory /home/$USER/web/$DOMAIN.TLD/public_html>
	AllowMethods GET HEAD POST PUT DELETE CONNECT OPTIONS TRACE PATCH PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK
</Directory>
PS. Check if you have loaded apache module mod_allowmethods. More info please read here: https://httpd.apache.org/docs/2.4/mod/m ... thods.html

Re: Http request methods - apache2

Posted: Thu Apr 11, 2019 12:50 pm
by pht
dreiggy wrote:
Wed Apr 10, 2019 8:24 pm
Try create custom httpd include for domain:

/home/$USER/conf/web/httpd.$DOMAIN.TLD.conf-allowmethods

Code: Select all

<Directory /home/$USER/web/$DOMAIN.TLD/public_html>
	AllowMethods GET HEAD POST PUT DELETE CONNECT OPTIONS TRACE PATCH PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK
</Directory>
PS. Check if you have loaded apache module mod_allowmethods. More info please read here: https://httpd.apache.org/docs/2.4/mod/m ... thods.html
file added, mod_allowmethods enabled - still only GET

Re: Http request methods - apache2

Posted: Thu Apr 11, 2019 2:39 pm
by dreiggy
Check if it is correctly loaded by apache:
httpd -l | grep mod_allowmethods

Re: Http request methods - apache2

Posted: Fri Apr 12, 2019 5:22 am
by pht

Code: Select all

root@malawishop:~# httpd -l | grep mod_allowmethods
-bash: httpd: command not found
root@malawishop:~# apache2 -l | grep -i mod_allowmethods
root@malawishop:~# apache2 -l
Compiled in modules:
  core.c
  mod_so.c
  mod_watchdog.c
  http_core.c
  mod_log_config.c
  mod_logio.c
  mod_version.c
  mod_unixd.c
root@malawishop:~# apachectl -M | grep -i allowmethods
 allowmethods_module (shared)
httpd -l not worked for me, but i can listed modules by apachectl -M