0

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.

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.