Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

4 Answers 4

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: .*'

Reference

https://github.com/simsong/tcpflow

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

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:

http://serverfault.com/questions/84750/monitoring-http-traffic-using-tcpdump

share|improve this answer

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

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.