Can mod_proxy be configured to write all HTTP traffic to a log file, including request and response headers and body?


I don't believe so, though doing so would be a trivial task for tcpdump.

| improve this answer | |

Elaborating on ErikA's answer:

A simple way of doing this is to capture all traffic on port 80 to a file:

tcpdump -w /tmp/packets port 80

And then use "strings" to extract the text content of the packets:

strings /tmp/packets

This will include some garbage but will generally get you what you need. You can also use the "Follow TCP Stream" feature in Wireshark to get a cleaner version of the same thing.

Life is a little more difficult if you're working with SSL traffic. A typical solution would be to use stunnel to intercept the SSL traffic and then proxy it to your web server over the loopback interface; this lets you capture the unencrypted traffic.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.