ubuntu apache 安装awstats 流量分析工具(命令方式)
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
root@www:~# apt-get install awstatsroot@www:~# vi /etc/awstats/awstats.conf# line 122: change# If your config for log format in httpd.conf is 'combined' Set here '1'# If log-config is 'common' set here '4', but in this case, some informations can't be get (browser info and so on)LogFormat=1# line 153: specify hostnameSiteDomain="www.server.world"# line 168: set IP address you'd like to excludeHostAliases="localhost 127.0.0.1 REGEX[server\.world$] REGEX[^10\.0\.0\.]"# line 222: changeDirIcons="./icon"root@www:~# mkdir /var/www/awstats root@www:~# ln -s /usr/share/awstats/icon /var/www/awstats/icon root@www:~# vi /etc/apache2/sites-available/default<Directory "/usr/lib/cgi-bin">AllowOverride NoneOptions +ExecCGI -MultiViews +SymLinksIfOwnerMatchOrder allow,denyAllow from 10.0.0.0/24# IP address you allow</Directory># add these lines<Location /awstats>Order deny,allowDeny from allAllow from 10.0.0.0/24# IP address you allow</Location></VirtualHost>root@www:~# service apache2 restart * Restarting web server apache2... waiting ...done.# generate reportsroot@www:~# /usr/lib/cgi-bin/awstats.pl -config=apache -update Create/Update database for config "/etc/awstats/awstats.conf" by AWStats version 6.95 (build 1.943)From data in log file "/var/log/apache2/access.log"...Phase 1 : First bypass old records, searching new record...Searching new records from beginning of log file...Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...Reverse DNS lookup for ::1 not available without ipv6 plugin enabled.Jumped lines in file: 0Parsed lines in file: 105Found 0 dropped records,Found 0 corrupted records,Found 0 old records,Found 105 new qualified records.# generate HTML reports from reports aboveroot@www:~# /usr/lib/cgi-bin/awstats.pl -config=apache -output -staticlink > /var/www/awstats/index.html
|
浙公网安备 33010602011771号