Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

How can I monitor incoming HTTP requests to port 80? I have set up web hosting on my local machine using DynDNS and Nginx. I wanted to know how many request are made on my server every day.

Currently I'm using this command:

netstat -an | grep 80
share|improve this question

You may use tcpdump.

# tcpdump filter for HTTP GET 
sudo tcpdump -s 0 -A 'tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420'

# tcpdump filter for HTTP POST 
sudo tcpdump -s 0 -A 'tcp dst port 80 and (tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354)'

For a solution using tshark see:


share|improve this answer
That's so helpful. Is there something similar for thrift messages? – user973810 Jul 27 '15 at 20:44

Do you have log files turned on for your server? If you do, I'd recommend installing AwStats and running your log files with it to get accurate reporting.

If you want to just monitor all incoming/outgoing traffic, you can use WireShark.

share|improve this answer

You can also tail the log file:

tail -f /path/to/access_log

The -f parameter will cause tail to continually update the screen as new entries are written to the log.

share|improve this answer

I've been using tcpflow to check incoming requests at aws instances, maybe there's a way to aggregate requests daywise.

STEP 1 - installation

# yum install --nogpgcheck http://pkgs.repoforge.org/tcpflow/tcpflow-0.21-1.2.el6.rf.x86_64.rpm

STEP 2 - track GET/POST requests at port 80

# tcpflow -p -c -i eth0 port 80 | grep -oE '(GET|POST|HEAD) .* HTTP/1.[01]|Host: .*'



share|improve this answer

Run this

while true
echo -----`date '+%r'` -----:
netstat -ant | grep :8080 | awk '{print $6}' | sort | uniq -c | sort -n
echo httpd processes: [`ps aux | grep httpd | wc -l`]
echo .
sleep 2

It will monitor traffic on 8080 port every 2 seconds

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.