Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have nginx running on port 80 and apache running on port 8080

I want to transfer all the traffic to both nginx and apache asynchronously i.e the performance of one server wont be dependent on the others. The reason being nginx will serve my website and apache will be used to run analytics on the traffic.

I want to mirror/copy the traffic on both port. I dont want FORWARDING ...

I tried the following but in vain ...

sudo iptables -A PREROUTING -t mangle -p tcp ! -s 127.0.0.1/32 --dport 80 -j TEE --gateway 127.0.0.1

and

sudo iptables -A POSTROUTING -t nat -p tcp -s 127.0.0.1/32 --dport 8080 -j SNAT --to 127.0.0.1:8080

Where am I going wrong ?

I am using iptables v1.4.10 on ubuntu 11.04

share|improve this question
    
try this article: myopenrouter.com/article/10917/… –  Sirex Feb 8 '12 at 11:26
add comment

1 Answer

Simply impossible. You can only capture and analyse mirrored traffic with packet sniffer of some sort but not regular apache (or any process) listening on socket.

share|improve this answer
add comment

Your Answer

 
discard

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.