pythontr.com
aptitude install awstats aptitude install libgeo-ip-perl libgeoip1 geoip-database
vim /home/www/awstats/index.html <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[url]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd[/url]"> <html xmlns="[url]http://www.w3.org/1999/xhtml[/url]"> <head> <meta HTTP-EQUIV="REFRESH" content="0; url=/cgi-bin/awstats.pl"> </head> <body> <a href="/cgi-bin/awstats.pl">awstats</a> </html>
vim /etc/apache2/sites-available/default # awstats Alias /awstats "/var/www/awstats" ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> # awstats icin parola gerekiyor <FilesMatch "awstats.pl"> AuthName "Guvenli Giris" AuthType Basic AuthUserFile /var/www/htpassizleme require valid-user </FilesMatch> # awstats icon Alias /awstats-icon/ /usr/share/awstats/icon/ <Directory /usr/share/awstats/icon> Options None AllowOverride None Order allow,deny Allow from all </Directory>
vim /etc/nginx/sites-enabled/default # /awstats-icon/ location ~ ^/awstats-icon/(.*)$ { alias /usr/share/awstats/icon/$1; access_log off; expires 30d; }
/usr/bin/perl /usr/lib/cgi-bin/awstats.pl -update -config=www.mysite.com
/usr/bin/mergelog /var/log/apache2/access.log /var/log/nginx/access.log > /var/log/apache_nginx_merge.log
vim /home/www/awstats/awstats_merge.sh #!/bin/bash MERGE="/usr/share/awstats/tools/logresolvemerge.pl" DIR="/home/www/awstats" LOG_APACHE="/var/log/apache2/access.log" LOG_NGINX="/var/log/nginx/access.log" cp $LOG_APACHE $DIR/access_apache.log cp $LOG_NGINX $DIR/access_nginx.log $MERGE $DIR/access_apache.log $DIR/access_nginx.log >$DIR/access_merged.log.tmp mv $DIR/access_merged.log.tmp $DIR/access_merged.log
crontab -e 25 * * * * sh /home/www/awstats/awstats_merge.sh >/dev/null 2>&1 30 * * * * /usr/bin/perl /usr/lib/cgi-bin/awstats.pl -update -config=www.mysite.com
vim /etc/awstats/awstats.conf LogFile="/home/www/awstats/access_merged.log" SiteDomain="mysite.com" LogFormat=1 HostAliases="www.mysite.com localhost 127.0.0.1" DNSLookup=0 LoadPlugin="geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat" Lang="en"
Yorumlar