WS7 Method Not Allowed
I have a trivial little CGI script that is resulting in a "Method Not Allowed" error when I run it on my Web Server 7 installation.
Here the CGI script:
#!/usr/bin/perl
printf("Location: /tmp/confirm.htm\n\n");
The confirm.htm is just a simple HTML page with a confirmation message in it.
The message I see in my server's errors log is this:
[03/Apr/2007:11:43:59] config (15015):for host 160.32.2.1 trying to POST /tmp/confirm.htm
while trying to POST /cgi-bin/redir.pl, handle-processed reports:
HTTP2205: The request method is not applicable to the requested resource.
If I invoke this script as the action in a form with method="post", I get this error. If I do a GET of this script's URL, the redirect works fine.
Sample form HTML:
<html><head></head><body>
<form method="post" action="/cgi-bin/redir.pl">
<input type="submit">
</form>
</body></html>
What's going on here?
Thanks,
Bill
[1231 byte] By [
wgkorba] at [2007-11-26 23:53:28]

# 1
Your CGI program is dispatching a POST request to an HTML file, and your server is configured not to allow POSTs to HTML files. (Which makes some sense; while GET makes sense for HTML files, POST probably doesn't.)
If you want to allow POSTs to HTML files, you could locate the send-file line in the obj.conf configuration file and add POST to the listed methods.
# 2
Hmmm...I think it's already configured as you suggest:
Service method="(GET|HEAD|POST)" type="*~magnus-internal/*" fn="send-file"
Incidentally, this is how it was configured upon install...I didn't change it.
Thanks,
Bill
# 4
After talking to Carlos at Sun support, we deduced that this was being caused by having Server-parsed HTML (All HTML files) enabled on this server. This smells like a potential bug, but Carlos is still looking into it.
In the meantime, disabling server-parsed HTML allowed this to work as it should. Since this customer was not actually making use of any SSIs or anything of that nature, this work-around is acceptable.
FWIW.
Bill