Apache
List Distinct IPs on Your Apache Access Log
If you ever need to look at the IPs on your access_log at some point here is a quick reference.
cat access_log|awk '{print $1}'|sort|uniq -c
This will list all IP, sort them ascending and count their occurrence and prepend that count for each IP found.
List and Count HTTP Connections
If you are investigating how many connections your HTTP server is getting probably if you suspect a Denial of Service attack or just plain interested, here is a simple command.
netstat -plant|grep :80|awk '{print $5}'|cut -d: -f1|sort|uniq -c|sort -n
It can be interchanged with any other services i.e. SMTP, just change :80 to :25.