Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

migrated from Nov 17 '10 at 18:18

This question came from our site for pro webmasters.

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

share|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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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