405 (Method not Allowed) when Apache Module DECLINED

This is a discussion on 405 (Method not Allowed) when Apache Module DECLINED within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hi!, I have a custom module that gets called via handlers for every request that hits the server. I am ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-23-2004
kalinga
 
Posts: n/a
Default 405 (Method not Allowed) when Apache Module DECLINED

Hi!, I have a custom module that gets called via handlers for every
request that hits the server. I am using the location tag with a "/" to
do this.

I don't do any processing in the custom moudle...I just return
DECLINED. The original URL I am pointing to is a .pl script. Without my
custom module, this script is able to accept POST requests. But the
moment I change the httpd.conf to include my handler, I get a
405(Method Post not allowed) Error.

It seems to be working okay if I hit the server with a GET from the
browser.

Does anyone know why this is happening?

Any help or direction in this matter will be greatly appreciated.
Thanks in advance.

Rahul

  #2 (permalink)  
Old 12-23-2004
André Malo
 
Posts: n/a
Default Re: 405 (Method not Allowed) when Apache Module DECLINED

* "kalinga" <rahul_41@yahoo.com> wrote:

> Hi!, I have a custom module that gets called via handlers for every
> request that hits the server. I am using the location tag with a "/" to
> do this.
>
> I don't do any processing in the custom moudle...I just return
> DECLINED. The original URL I am pointing to is a .pl script. Without my
> custom module, this script is able to accept POST requests. But the
> moment I change the httpd.conf to include my handler, I get a
> 405(Method Post not allowed) Error.
>
> It seems to be working okay if I hit the server with a GET from the
> browser.
>
> Does anyone know why this is happening?


Because your handler declined to handle the request. It ends up in the
default core handler, which doesn't handle POST requests.

nd
  #3 (permalink)  
Old 12-24-2004
kalinga
 
Posts: n/a
Default Re: 405 (Method not Allowed) when Apache Module DECLINED

Thanks André!,

Is there any way I can get over the problem so that the request hits
the URL and can post data to it? Please advice. Could you point me to
some place where such stuff is documented. I have been searching all
over the place but I can't find anything.

Thanks again for the response.

Regards,
rahul


André Malo wrote:
> * "kalinga" <rahul_41@yahoo.com> wrote:
>
> > Hi!, I have a custom module that gets called via handlers for every
> > request that hits the server. I am using the location tag with a

"/" to
> > do this.
> >
> > I don't do any processing in the custom moudle...I just return
> > DECLINED. The original URL I am pointing to is a .pl script.

Without my
> > custom module, this script is able to accept POST requests. But the
> > moment I change the httpd.conf to include my handler, I get a
> > 405(Method Post not allowed) Error.
> >
> > It seems to be working okay if I hit the server with a GET from the
> > browser.
> >
> > Does anyone know why this is happening?

>
> Because your handler declined to handle the request. It ends up in

the
> default core handler, which doesn't handle POST requests.
>
> nd


  #4 (permalink)  
Old 12-24-2004
André Malo
 
Posts: n/a
Default Re: 405 (Method not Allowed) when Apache Module DECLINED

* "kalinga" <rahul_41@yahoo.com> wrote:

> Is there any way I can get over the problem so that the request hits
> the URL and can post data to it? Please advice.


I'd suggest to use the fixup hook (which is invoked right before the
handler is run) to look if you still want to run your handler or something
else. If the latter happens, you just change r->handler to the desired value
(e.g. "cgi-script") then.

> Could you point me to
> some place where such stuff is documented. I have been searching all
> over the place but I can't find anything.


I've got most of my knowledge from the source ;) But there are good books
out there, e.g. "Writing Apache Modules with Perl and C".

nd
  #5 (permalink)  
Old 12-25-2004
kalinga
 
Posts: n/a
Default Re: 405 (Method not Allowed) when Apache Module DECLINED

Thanks a tonne André for pointing me in the right direction. I will
work on your suggestions after the weekend ;-)

Regards,
Rahul


André Malo wrote:
> * "kalinga" <rahul_41@yahoo.com> wrote:
>
> > Is there any way I can get over the problem so that the request

hits
> > the URL and can post data to it? Please advice.

>
> I'd suggest to use the fixup hook (which is invoked right before the
> handler is run) to look if you still want to run your handler or

something
> else. If the latter happens, you just change r->handler to the

desired value
> (e.g. "cgi-script") then.
>
> > Could you point me to
> > some place where such stuff is documented. I have been searching

all
> > over the place but I can't find anything.

>
> I've got most of my knowledge from the source ;) But there are good

books
> out there, e.g. "Writing Apache Modules with Perl and C".
>
> nd


  #6 (permalink)  
Old 12-31-2004
kalinga
 
Posts: n/a
Default Re: 405 (Method not Allowed) when Apache Module DECLINED

André, I finally solved the problem copying my code to the post
read-request phase instead of using handlers. This was I do not get a
405. Thanks for your help. I checked out the online copy of the book
"Writing Apache Modules with Perl and C"
(http://162.105.203.19/apache-doc/1.htm). It is pretty cool :o)



André Malo wrote:
> * "kalinga" <rahul_41@yahoo.com> wrote:
>
> > Is there any way I can get over the problem so that the request

hits
> > the URL and can post data to it? Please advice.

>
> I'd suggest to use the fixup hook (which is invoked right before the
> handler is run) to look if you still want to run your handler or

something
> else. If the latter happens, you just change r->handler to the

desired value
> (e.g. "cgi-script") then.
>
> > Could you point me to
> > some place where such stuff is documented. I have been searching

all
> > over the place but I can't find anything.

>
> I've got most of my knowledge from the source ;) But there are good

books
> out there, e.g. "Writing Apache Modules with Perl and C".
>
> nd


  #7 (permalink)  
Old 12-31-2004
André Malo
 
Posts: n/a
Default Re: 405 (Method not Allowed) when Apache Module DECLINED

* kalinga wrote:

> André, I finally solved the problem copying my code to the post
> read-request phase instead of using handlers. This was I do not get a
> 405. Thanks for your help. I checked out the online copy of the book
> "Writing Apache Modules with Perl and C"
> (http://162.105.203.19/apache-doc/1.htm). It is pretty cool :o)


Fine :)

nd
--
Already I've seen people (really!) write web URLs in the form:
http:\\some.site.somewhere
[...] How soon until greengrocers start writing "apples $1\pound"
or something? -- Joona I Palaste in clc

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:50 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0