3

I developed a symfony2 restful backend, and locally everything work.

So I deployed the app on an apache2 server (wrapped by directadmin) and wierd errors come up:

Basically when I send a DELETE (even PUT/POST it depends on the api) the server respond like a GET.

In order to better explain the issue I paste the log of a curl cmd:

$ curl -X DELETE website/api/sign/ -H "apiKey:7WJiHShAYPBI0asK1ZaKlJzpnn550X08" -v
* Hostname was NOT found in DNS cache
*   Trying <ip here>...
* Connected to www.website.com (<ip here>) port 80 (#0)
> DELETE /api/sign/ HTTP/1.1
> User-Agent: curl/7.35.0
> Host: www.website.com
> Accept: */*
> apiKey:7WJiHShAYPBI0asK1ZaKlJzpnn550X08
> 
< HTTP/1.1 200 OK
< Date: Sun, 29 Mar 2015 16:13:07 GMT
* Server Apache/2 is not blacklisted
< Server: Apache/2
< X-Powered-By: PHP/5.3.16
< Cache-Control: no-cache
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE
< Access-Control-Allow-Headers: X-Requested-With, origin, content-type, accept, apiKey
< X-Symfony-Cache: GET /api/sign/: miss
< Vary: Accept-Encoding,User-Agent
< Content-Length: 279
< Content-Type: application/json

And so then the content is the content relative to the GET Request...

Don't actually got why but I've already added all OPTIONS api.

Matteo425
  • 168
  • 9

1 Answers1

1

SOLUTION:

http://forum.directadmin.com/showthread.php?t=35402

the issue was just that PUT and DELETE were disabled in httpd

change httpd.conf in this way solved the issue:

[old httpd.conf]

<Directory /home/*>
  AllowOverride All
  Options -MultiViews -Indexes FollowSymlinks IncludesNoExec +Includes
  <Limit GET POST OPTIONS PROPFIND>
    Order allow,deny
    Allow from all
  </Limit>
  <LimitExcept GET POST OPTIONS PROPFIND>
    Order deny,allow
    Deny from all
  </LimitExcept>
</Directory>

and

[new httpd.conf]

<Directory /home/*>
  AllowOverride All
  Options -MultiViews -Indexes FollowSymlinks IncludesNoExec +Includes
  <Limit GET POST OPTIONS PROPFIND PUT DELETE>
    Order allow,deny
    Allow from all
  </Limit>
  <LimitExcept GET POST OPTIONS PROPFIND PUT DELETE>
    Order deny,allow
    Deny from all
  </LimitExcept>
</Directory>
Matteo425
  • 168
  • 9