Hi,
I have some problem with apache configuration and hope to get your help!
For some reason I lost POST data in part of requests (not consistent). As I found it may be caused by some rewrite rules.
Now I try to implement in some way translation of POST to GET requests on apache side (since it can't be done on client).
A I found in apache documentation ([
httpd.apache.org ] that I can use Script Directive to apply perl script on request with the specific method.
I entered to the httpd.conf the following code:
# Define the folder as container for CGI handler
<Directory /<full path to local folder> >
Options +ExecCGI
</Directory>
# Define file types for CGI handler
AddHandler cgi-script cgi pl
# Apply specific script on any POST request
Script POST /<folder>/try.pl
Where the script will change the POST method to GET method using this code: [
modperlbook.org ]
but for now it only should create the log file and print there request:
#!/bin/perl
use warnings;
use strict;
use Apache2::Const -compile => qw(M_GET);
use Output::Cmd;
my $logfile = "/tmp/try.log";
my $u = Output::Cmd->new('verbose' => 1, 'log' => $logfile);
my $r = shift;
$u->print("request: $r");
1;
I expect to get log file once any POST request is sent to the server, but it does not created...
Can somebody help me to understand how to tune this correctly?
Thank you in advance,
Daniel