Linux: Can I monitor all http connections to the site live? like tail -f /file/log.log only for http connections

iptableslinuxsshtail

I want to monitor whether or not people are accessing my site live. I want to see the http connections made to my site in terminal/ssh. Something like a tail -f /file/log.log function but I believe there is a way without using a log file right?

I was reading some of the other peoples' questions here, it seems "IPTstate" is what I'm looking for, anyone to confirm this does what I'm asking? I'm not much of a server admin.

Best Answer

There is no one answer.

  • IPTables packet and byte counts will show new connections coming into to your server. I only use this to verify the connections are going through the right rules.
  • I generally look at the access log for the web server. It provides a bunch of information you can't easily get from monitoring the tcp stack. tail -f on the log is useful to see if connections are getting processed properly.
  • Watching netstat can show connections to port 80 and/or port 443. TCPDUMP will show packet level monitoring data.
  • Enabling server-status in apache allows you to query what the server is doing and has recently done.
  • A system monitor like munin can track accesses and load on the web server.
  • A log analysis tool like awstats will give you relatively current data with history and a lot of useful breakdowns. This is useful to see trends over time.
  • Google analytics will give you information similar to awstats, but based on active code run when your site is accessed.

Which solution is appropriate depends on your needs. You may choose to use more than one solution.