How do we put username is apache access_log with Perl without HTTP auth? For PHP, the solution is in this link.
I need to achieve the similar result using Perl.
How do we put username is apache access_log with Perl without HTTP auth? For PHP, the solution is in this link.
I need to achieve the similar result using Perl.
There is a similar mechanism to the way PHP does this in mod_perl: https://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_notes_ .
Of course you need to run mod_perl in this case and not a simple CGI script. But this is also valid for the PHP solution which would work with mod_php but not when running using PHP as a CGI script. The reason is that CGI scripts are a separate process and don't have access to the internal state of the request inside Apache and can not manipulate it.
With a CGI script you might instead write the information into a response header and log this as described here. But remember that this header is also sent to the browser, so don't put confidential information in it.