post with curl - error 501

Hi,

Friend of my set up for me an apache server (Apache/2.2.0 (Fedora),
php5, mod_rewrite, etc.. - http://serwer2.profprojekt.com.pl/info.php).

Everything works just fine, but i can't send HTTP_Request with data in
POST using CURL. Server returns error:

------------------------------------------------------------ --------------------------
501 Method Not Implemented

Method Not Implemented
POST to /app/webroot/cake_gateway.php not supported.
------------------------------------------------------------ --------------------------

When i'm sending requests with post using forms or ajax server manages
it faultlessly...

Anyone knows where should we looking for bug ?

best
wojtek
kolodziejczyk.wojtek [ So, 23 September 2007 03:53 ] [ ID #1827246 ]

Re: post with curl - error 501

Post removed (X-No-Archive: yes)
Notifier Deamon [ So, 23 September 2007 09:41 ] [ ID #1827247 ]

Re: post with curl - error 501

>
> In your code probably.
> Davide
>

Code is ok, it's working great on my local server as well as on other
servers. Problem occurring only on this one server - it's seems like
the server doesn't handle with HTTP_Request with data in POST from it
self.

I hope i'm understandable ;)

best
wojtek
kolodziejczyk.wojtek [ So, 23 September 2007 12:20 ] [ ID #1827251 ]

Re: post with curl - error 501

On Sep 23, 11:20 am, void <kolodziejczyk.woj... [at] gmail.com> wrote:
> > In your code probably.
> > Davide
>
> Code is ok, it's working great on my local server as well as on other
> servers. Problem occurring only on this one server - it's seems like
> the server doesn't handle with HTTP_Request with data in POST from it
> self.
>
> I hope i'm understandable ;)
>
> best
> wojtek

look for LIMIT directives on this server that your friend set up.

Maybe he has set

<LimitExcept GET>
Order allow,deny
Deny From All
</LimitExcept>

whereas you need

<LimitExcept GET POST>
Order allow,deny
Deny From All
</LimitExcept>

it could be this, have yohu tried using a proxy server to see what
headers your server returns.
What about the confniguration of cake, has POST been banned in there
for that directory. Perhaps everything is rewritten via a php script
which does not allow POST and sends back the area you are seeing.
shimmyshack [ So, 23 September 2007 15:02 ] [ ID #1827254 ]

Re: post with curl - error 501

Post removed (X-No-Archive: yes)
Notifier Deamon [ So, 23 September 2007 16:13 ] [ ID #1827255 ]

Re: post with curl - error 501

ok, i've solved the problem

it was about mod_security. Replacing row with

SecRule REQUEST_HEADERS:Content-Type "!(?:^(?:application/x-www-form-
urlencoded$|multipart/form-data;)|text/xml)"
to
SecRule REQUEST_HEADERS:Content-Type "!(?:^(?:application/x-www-form-
urlencoded$|multipart/form-data;)|text/xml|application/x-amf )"

makes it works perfectly.

thanks for your time
best
wojtek
kolodziejczyk.wojtek [ So, 23 September 2007 16:30 ] [ ID #1827256 ]

Re: post with curl - error 501

On Sep 23, 3:13 pm, Davide Bianchi <davideyeahs... [at] onlyforfun.net>
wrote:
> On 2007-09-23, shimmyshack <matt.fa... [at] gmail.com> wrote:
>
> > look for LIMIT directives on this server that your friend set up.
>
> The fact is, that he said in is first post that if he uses
> something else and not curl it works fine, so that make me think
> that the server config is ok, is something in the way the request
> is made that is wrong. Unless when he said
> "it works when I use forms or ajak" he meant something else...
>
> Davide
>
> --
> The difference between math and physics is the difference between
> masturbation and sex. They're both messy, but physics can get you in
> much more trouble. -- Paul Tomblin & Malcom Ray

yeah sorry Davide, I didn't spot that. As you said it turned out to be
his code the whole time which he solved by ammending his mod security
rule for some reason.
shimmyshack [ Mo, 24 September 2007 01:57 ] [ ID #1827926 ]
Webserver » alt.apache.configuration » post with curl - error 501

Vorheriges Thema: enhanced apache password security
Nächstes Thema: Track mod_cache hit/miss rate