Some times its hard to make changes to productions servers configuration. In apache you can check http.conf syntax before you restart or reload the service.
# /usr/sbin/httpd -t
Some times its hard to make changes to productions servers configuration. In apache you can check http.conf syntax before you restart or reload the service.
# /usr/sbin/httpd -t
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.
#!/bin/sh
echo 'Number of unique visitors'
cat /var/log/apache/www.yoursite.com-access.log |awk '{print $1}' | sort | uniq | wc -l
echo 'Ip of unique visitors'
cat cat /var/log/apache/www.yoursite.com-access.log |awk '{print $1}' | sort | uniq | wc -l |awk '{print $1}' | sort | uniq
A bash command to search for all hidden files recursively in the current directory but ignore apache .htaccess files.
find . -type f \( -iname ".*" ! -iname ".htaccess" \)
Some cat with awk and then sort to find out what ips are most common in your apache access.log file. Remember that all ips are include here. Bots, crawlers, clients…
cat /path/to/log | awk '{print $3}' | sort | uniq -c | sort -rn | head -20