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
add comment

3 Answers

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
add comment

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
add comment

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