Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: [solved] Apache 24 How to allow PUT AllowMethods not working |
|
Author |
|
Damned
Joined: 11 Mar 2016 Posts: 1 Location: Sweden
|
Posted: Fri 11 Mar '16 15:22 Post subject: [solved] Apache 24 How to allow PUT AllowMethods not working |
|
|
Hi!
This has been solved. See Edit #2 in bottom.
I am currently hosting a asp.net MVC4 web application with REST-api.
Running on Apache 2.4.10 on a Debian Jessie.
With virtual host based mod_mono
Mono version 4.2.2
Everything is working fine. Except one thing. PUT is not allowed.
I have tried googling. Alot! But I just can't see how to allow this in Apache.
I have tried editing my vhost.conf with AllowMethods.
If I remove GET, well, GET is not allowed and I can't do anything with the webapp.
But when I put "PUT" in there - it has no effect.
My vhost conf:
http://apaste.info/VEM
.htaccess is not being used
This is the output of nmap:
Code: | PORT STATE SERVICE
80/tcp open http
|_http-methods: OPTIONS GET HEAD POST |
As for the actual error.
access.log gives:
Code: | fta.domain.nu:80 IP - - [11/Mar/2016:13:34:48 +0100] "PUT /api/Players/1001 HTTP/1.1" 403 526 "http://fta.domain.nu/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.103 Safari/537.36"
|
Chrome developer tools reports the error as:
PUT http://fta.domain.nu/api/Players/1001 403 (Forbidden)
Code: | <html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /api/Players/1001
on this server.<br />
</p>
<hr>
<address>Apache/2.4.10 (Debian) Server at fta.domain.nu Port 80</address>
</body></html> |
Could someone please tell me how to allow PUT?
EDIT:
I'd like to add. This has been working before on another server I no longer have access to.
I think it was an Ubuntu LTS of some kind, and Apache 2.2
EDIT#2:
Wow. Seems the default mod_mono vhost I used (autogenerated) isn't compatible with Apache 2.4 syntax.
James Bond actually solved this for me from the hints in this thread:
https://www.apachelounge.com/viewtopic.php?t=7018
Quote: | Allow from all is no longer an option. Do not mix 2.2 config with the new 2.4 style ( Require). |
If you had any idea how many hours i spent on this problem... |
|
Back to top |
|
|
|
|
|
|