I've got a Fedora LAMP server on Amazon EC2 functioning as a HTTP pseudo-proxy (Sorry, don't know the terminology- It's not a true proxy where requests are relayed through apache, rather client requests are being translated by a PHP script, which then sends a new request.)

I'd like to be able to fully log the HTTP cycle

  1. CLIENT -> PROXY
  2. PROXY -> SERVICE
  3. SERVICE -> PROXY
  4. PROXY -> CLIENT

I'm hoping to do this using BASH tools- thinking netcat? Looking for advice and examples. Thanks!

link|improve this question

67% accept rate
netcat is a Unix/Linux tool rather than a Bash tool. Perhaps you mean "using Linux tools in a Bash script"? – Dennis Williamson Apr 29 '10 at 15:58
Correct- I just want to be able to use available shell tools vs having to install new software – Yarin Apr 29 '10 at 16:02
Gotta say I'm surprised by the radio silence- didn't think this was an obscure question- Does ServerFault not yet have the critical mass of StackOverflow..? – Yarin May 2 '10 at 12:46
StackOverflow seems to have far more users then ServerFault. – Stefan Lasiewski May 26 '10 at 18:20
feedback

1 Answer

up vote 1 down vote accepted

If I understand your question correctly, I'd use both netcat and tcpdump. tcdump is a *nix tool that dumps the traffic on a network. You can specify things like the NIC you want to dump, the protocol or the source/destination ips.

It's very useful when debugging or troubleshooting networking problems.

More info about tcpdump here and some good examples here.

link|improve this answer
Thanks Marcos- How do the two compare? When would you use one over the other? Also, have you used Ethereal, or any other tcpdump guis? – Yarin May 27 '10 at 12:26
@Yarin: in this specific case I'd use tcpdump. And yes, I've used Ethereal and it's great as a Tcpdump GUI (the best, imho :)) – Marco Ramos May 27 '10 at 12:57
feedback

Your Answer

 
or
required, but never shown

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