All posts by admin

Simple way to get stats from Apache

This way you can get stats from your logs but this method is a little bit rudimentary as you are going to get visits from crawlers, bots,… that are not real visits. Parse your logs directly with awk.

 bash | 
 
 copy code |
?

1
#!/bin/sh
2
3
4
echo 'Number of unique visitors'
5
6
cat /var/log/apache/www.yoursite.com-access.log |awk '{print $1}' | sort | uniq | wc -l
7