top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Getting error 403 forbidden while using HTTP PUT method

+1 vote
1,883 views

I am using Apache Tomcat 8.0.0-RC3 Server and spring dispatcher servlet . I am getting 403 forbidden while using HTTP PUT method but HTTPGET method is working properly. I am trying to solve this with security constraint but it is giving me 409 conflict error because I am using spring dispatcher servlet and It is not working.But It is working perfect on tomcat 7 .Please help me to get rid of this .

posted Oct 3, 2013 by Ahmed Patel

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
Per the servlet spec, the default implementation for HttpServlet is to respond to PUT requests with a 405 Method Not Allowed (for HTTP 1.1 connections) or a 400 Bad Request (for all other connections).

You could still be getting a 403 based upon your security constraints. Can you post them here?

3 Answers

+1 vote

Try debugging to find what exact component sets that error code. (See Tomcat FAQ -> troubleshooting)

E.g.
a. Does the call reach DispatcherServlet, or it is rejected before that (e.g. by a security constraint).
b. A breakpoint in Response.sendError() might help.

Tomcat itself has examples that use PUT requests. You may check whether those work in 8.0.0-RC3.

a) Remote API of the Manager web application. It is usually used from Ant tasks. http://tomcat.apache.org/tomcat-8.0-doc/manager-howto.html

b) WebDAV servlet. http://tomcat.apache.org/tomcat-8.0-doc/api/org/apache/catalina/servlets/WebdavServlet.html

answer Oct 3, 2013 by Bob Wise
+1 vote

As far as I know, Tomcat by default does not accept PUT requests.
(Just think of what it really does; it would be a real security issue if it worked by default).
To accept PUT requests, you need an application that handles such requests specifically.
Can you share your code here?

answer Oct 5, 2013 by Satyabrata Mahapatra
0 votes

As far as I know, Tomcat by default does not accept PUT requests. (Just think of what it really does; it would be a real security issue if it worked by default).

To accept PUT requests, you need an application that handles such requests specifically. (For example : DAV). Are you sure that your problem is not because in Tomcat 7 you have an application which accepts PUT requests, but in Tomcat 8 you do not ?

answer Oct 3, 2013 by Salil Agrawal
Similar Questions
+1 vote

enter image description here

This pic is what i am geting error response from server(HTTP 406). Actually i am trying to post some content from CKeditor, but normal text with styles type of content is accepting by server when i add table content server not accepting.

+2 votes

I have apache server in my local network installed from apt-get install apache2, but my php version is old version and I divided to make compile the apache and add php5.4 module.I want compile this apache from source code httpd-2.4.10 version, my ./configure this:

./configure --prefix=/usr/local/apache2  --enable-so --sysconfdir=/etc/httpd/conf

this work for default apache webserver, but my vhosts don't work, they are status 403 "dont forbidden access".
not want to do different from apache in apt-get install, but I want apache and PHP lasts releases from my server.

How to make vhosts config in apache compiled from source code httpd-2.4.10, i need resolve this "problem" for my environment.

+2 votes

I recently used the Perl Framework, which is a Perl centric Http test kit. I followed the instructions mentioned in the readme available within the framework which I checked out from the link

http://svn.apache.org/repos/asf/httpd/test/framework/trunk/

The readme states the following steps:
1. You need an installation of Apache. (Either 1.3 or 2.0)
2. Any DSOs you wish to use should be configured in that Apaches
httpd.conf (the test harness will pick this configuration up)
3. Setup:
perl Makefile.PL -apxs /path/to/apache/bin/apxs
4. Run the tests:
t/TEST
5. Evaluate test output.

However, I get an error when I get to the 3rd step saying;

"Cant open perl script "/Perl": No such file or directory"

Hope someone could clarify whats happening here.

+1 vote

I was curious as to why the following wget returns a 403/forbidden. The base url is accessed via the ff/chrome browser.. As far as I can tell/see, the cmd should match what the network is seeing regarding the headers/traffic.

wget -vvv --user-agent="Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0"  --cookies=on  --load-cookies=aa.lwp  --keep-session-cookies  --save-cookies=aa.lwp  --referer http://coursebook.utdallas.edu 
...