湖濱散記部落格的樹心幽徑[login][主頁]
313:20141228 awstats7.3 安裝記錄優(www.kmvs.km.edu.tw)

(1)
[root@www lnx]# wget http://prdownloads.sourceforge.net/awstats/awstats-7.3.tar.gz
2014-12-28 10:46:30 (253 KB/s) - `awstats-7.3.tar.gz' saved [2897463/2897463]

(2)
[root@www lnx]# tar xvzf awstats-7.3.tar.gz
[root@www lnx]# cd awstats-7.3/
[root@www awstats-7.3]# ls
docs  README.TXT  tools  wwwroot
[root@www awstats-7.3]#

[root@www lnx]# mv awstats-7.3 /usr/local/awstats
[root@www lnx]# ls /usr/local/awstats -l
總計 20
drwxr-xr-x 4 webadm webadm 4096  1月 29  2014 docs
-rw-r--r-- 1 webadm webadm 7020  1月 29  2014 README.TXT
drwxr-xr-x 5 webadm webadm 4096 11月  4  2013 tools
drwxr-xr-x 7 webadm webadm 4096 11月  4  2013 wwwroot
[root@www lnx]#

(3)
[root@www lnx]# cd /usr/local/awstats
[root@www awstats]# cd tools/
[root@www tools]# pwd
/usr/local/awstats/tools
[root@www tools]# perl awstats_configure.pl

----- AWStats awstats_configure 1.0 (build 20140126) (c) Laurent Destailleur ---                                             --
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
- You are not an administrator user,
- You want to analyze downloaded log files without web server,
- You want to analyze mail or ftp log files instead of web log files,
- You need to analyze load balanced servers log files,
- You want to 'understand' all possible ways to use AWStats...
Read the AWStats documentation (docs/index.html).

-----> Running OS detected: Linux, BSD or Unix

-----> Check for web server install
  Found Web server Apache config file '/usr/local/apache2/conf/httpd.conf'

-----> Check and complete web server config file '/usr/local/apache2/conf/httpd.                                             conf'
Warning: You Apache config file contains directives to write 'common' log files
This means that some features can't work (os, browsers and keywords detection).
Do you want me to setup Apache to write 'combined' log files [y/N] ? y
  Add 'Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"'
  Add 'Alias /awstatscss "/usr/local/awstats/wwwroot/css/"'
  Add 'Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"'
  Add 'ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"'
  Add '<Directory>' directive
  AWStats directives added to Apache config file.

-----> Update model config file '/usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf'
  File awstats.model.conf updated.

-----> Need to create a new config file ?
Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ? y

-----> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
> www.kmvs.km.edu.tw

-----> Define config file path
In which directory do you plan to store your config file(s) ?
Default: /etc/awstats
Directory path to store config file(s) (Enter for default):
>

-----> Create config file '/etc/awstats/awstats.www.kmvs.km.edu.tw.conf'
 Config file /etc/awstats/awstats.www.kmvs.km.edu.tw.conf created.

-----> Restart Web server with '/sbin/service httpd restart'
Redirecting to /bin/systemctl  restart httpd.service
Job failed. See system journal and 'systemctl status' for details.

-----> Add update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.kmvs.km.edu.tw
Or if you have several config files and prefer having only one command:
/usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue...


A SIMPLE config file has been created: /etc/awstats/awstats.www.kmvs.km.edu.tw.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'www.kmvs.km.edu.tw' with command:
> perl awstats.pl -update -config=www.kmvs.km.edu.tw
You can also read your statistics for 'www.kmvs.km.edu.tw' with URL:
> http://localhost/awstats/awstats.pl?config=www.kmvs.km.edu.tw

Press ENTER to finish...

[root@www tools]#



(4)

[root@www tools]# cat /usr/local/apache2/conf/httpd.conf|grep CustomLog
    # a CustomLog directive (see below).
    CustomLog "logs/access_log" combined
    #CustomLog "logs/access_log" combined
[root@www tools]#



(5)
[root@www tools]# cat /usr/local/apache2/conf/httpd.conf

:
#
# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"

#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory "/usr/local/awstats/wwwroot">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>


(6)
[root@www tools]# ls /etc/awstats
awstats.www.kmvs.km.edu.tw.conf
[root@www tools]# cat /etc/awstats/awstats.www.kmvs.km.edu.tw.conf

(7)
[root@www tools]# vi /etc/awstats/awstats.www.kmvs.km.edu.tw.conf
[root@www tools]# cat /etc/awstats/awstats.www.kmvs.km.edu.tw.conf|grep LogFile
# "LogFile" contains the web, ftp or mail server log file to analyze.
# Example: "C:/WINNT/system32/LogFiles/W3SVC1/ex%YY-24%MM-24%DD-24.log"
LogFile="/usr/local/apache2/logs/access_log"
PurgeLogFile=0
# When PurgeLogFile is setup to 1, AWStats will clean your log file after
# This parameter is not used if PurgeLogFile=0
# Possible values: 0, 1, or tags (See LogFile parameter) for suffix
[root@www tools]#

(8)
[root@www tools]# cat /etc/awstats/awstats.www.kmvs.km.edu.tw.conf|grep LogType
LogType=W
[root@www tools]#

(9)
[root@www tools]# cat /etc/awstats/awstats.www.kmvs.km.edu.tw.conf|grep LogFormat
#     With LogFormat=4, some features (browsers, os, keywords...) can't work.
# LogFormat = 1
# LogFormat = "%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot"
# LogFormat = 2
LogFormat=1
# This parameter is not used if LogFormat is a predefined value (1,2,3,4)
# match the LogFormat parameter.
# Show the cluster report (Your LogFormat must contains the %cluster tag)
[root@www tools]#

(10)

[root@www tools]# cat /etc/awstats/awstats.www.kmvs.km.edu.tw.conf|grep SiteDomain
#                     will discard records not in SiteDomain nor HostAliases
# "SiteDomain" must contain the main domain name, or the main intranet web
SiteDomain="www.kmvs.km.edu.tw"
# You can repeat the "SiteDomain" value in this list.
[root@www tools]#



(11)
[root@www cgi-bin]# pwd
/usr/local/awstats/wwwroot/cgi-bin
[root@www cgi-bin]# ls
awdownloadcsv.pl  awredir.pl  awstats.model.conf  awstats.pl  lang  lib  plugins
[root@www cgi-bin]# perl awstats.pl -config=www.kmvs.km.edu.tw -update
Error: AWStats database directory defined in config file by 'DirData' parameter (/var/lib/awstats) does not exist or is not writable.
Setup ('/etc/awstats/awstats.www.kmvs.km.edu.tw.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
[root@www cgi-bin]#


(12)
[root@www cgi-bin]# mkdir /var/lib/awstats
[root@www cgi-bin]# chmod 777 /var/lib/awstats
[root@www cgi-bin]# perl awstats.pl -config=www.kmvs.km.edu.tw -update
Create/Update database for config "/etc/awstats/awstats.www.kmvs.km.edu.tw.conf" by AWStats version 7.3 (build 20140126)
From data in log file "/usr/local/apache2/logs/access_log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
AWStats did not find any valid log lines that match your LogFormat parameter, in the 50th first non commented lines read of your log.
Your log file /usr/local/apache2/logs/access_log must have a bad format or LogFormat parameter setup does not match this format.
Your AWStats LogFormat parameter is:
1
This means each line in your web server log file need to have "combined log format" like this:
111.22.33.44 - - [10/Jan/2001:02:14:14 +0200] "GET / HTTP/1.1" 200 1234 "http://www.fromserver.com/from.htm" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
And this is an example of records AWStats found in your log file (the record number 50 in your log):
163.25.20.95 - - [20/Sep/2012:17:27:11 +0800] "GET /index.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 HTTP/1.1" 200 2524
Setup ('/etc/awstats/awstats.www.kmvs.km.edu.tw.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
[root@www cgi-bin]#

(13)
[root@www cgi-bin]# vi /etc/awstats/awstats.www.kmvs.km.edu.tw.conf
[root@www cgi-bin]# cat /etc/awstats/awstats.www.kmvs.km.edu.tw.conf|grep LogFormat
#     With LogFormat=4, some features (browsers, os, keywords...) can't work.
# LogFormat = 1
# LogFormat = "%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot"
# LogFormat = 2
LogFormat=4
# This parameter is not used if LogFormat is a predefined value (1,2,3,4)
# match the LogFormat parameter.
# Show the cluster report (Your LogFormat must contains the %cluster tag)
[root@www cgi-bin]#

[root@www cgi-bin]# perl awstats.pl -config=www.kmvs.km.edu.tw -update
Create/Update database for config "/etc/awstats/awstats.www.kmvs.km.edu.tw.conf" by AWStats version 7.3 (build 20140126)
From data in log file "/usr/local/apache2/logs/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)...
Flush history file on disk (unique url reach flush limit of 5000)
Flush history file on disk (unique url reach flush limit of 5000)
:

Flush history file on disk (unique url reach flush limit of 5000)
Jumped lines in file: 0
Parsed lines in file: 18592501
 Found 821 dropped records,
 Found 0 comments,
 Found 0 blank records,
 Found 53594 corrupted records,
 Found 0 old records,
 Found 18538086 new qualified records.
[root@www cgi-bin]#


(14)

[root@www ~]# vi /etc/awstats/awstats.www.kmvs.km.edu.tw.conf
[root@www ~]# cat /etc/awstats/awstats.www.kmvs.km.edu.tw.conf|grep AllowToUpdateStatsFromBrowser
# Warning: If you want to be able to use the "AllowToUpdateStatsFromBrowser"
AllowToUpdateStatsFromBrowser=1
# AllowToUpdateStatsFromBrowser is set to 1.
# set AllowToUpdateStatsFromBrowser to 1, you can change this parameter to 1.
[root@www ~]#


(15)

[root@www ~]# vi /etc/awstats/awstats.www.kmvs.km.edu.tw.conf
[root@www ~]# cat /etc/awstats/awstats.www.kmvs.km.edu.tw.conf|grep Lookup
# With DNSLookup to 0, all hosts will be reported by their IP addresses and
# If you want/need to set DNSLookup to 1, don't forget that this will reduce
# Note: Result of DNS Lookup can be used to build the Country report. However
# have an accurate Country report with no need of DNS Lookup.
# 0 - No DNS Lookup
# 1 - DNS Lookup is fully enabled
# 2 - DNS Lookup is made only from static DNS cache file (if it exists)
DNSLookup=2
# This option is not used if DNSLookup=0.
# This option is used only if DNSLookup=1.
# This option is used only if DNSLookup=1.
SkipDNSLookupFor=""
[root@www ~]#


(16)

[root@www ~]# vi /etc/awstats/awstats.www.kmvs.km.edu.tw.conf
[root@www ~]# cat /etc/awstats/awstats.www.kmvs.km.edu.tw.conf|grep LoadPlugin
# Uncomment LoadPlugin lines to enable a plugin after checking that perl
#LoadPlugin="tooltips"
LoadPlugin="decodeutfkeys"
#LoadPlugin="ipv6"
#LoadPlugin="hashfiles"
#LoadPlugin="userinfo"
#LoadPlugin="hostinfo"
#LoadPlugin="clusterinfo"
#LoadPlugin="urlalias"
#LoadPlugin="timehires"
# LoadPlugin="timezone"
# LoadPlugin="timezone +2"
# LoadPlugin="timezone CET"
#LoadPlugin="timezone +2"
#LoadPlugin="rawlog"
#LoadPlugin="graphapplet /awstatsclasses"                               # EXPERIMENTAL FEATURE
#LoadPlugin="graphgooglechartapi"
#LoadPlugin="geoipfree"
#LoadPlugin="geoip GEOIP_STANDARD /pathto/GeoIP.dat"
#LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /pathto/GeoIPCity.dat"
#LoadPlugin="geoip_asn_maxmind GEOIP_STANDARD /usr/local/geoip.dat+http://enc.com.au/itools/aut-num.php?autnum="
#LoadPlugin="geoip_region_maxmind GEOIP_STANDARD /pathto/GeoIPRegion.dat"
#LoadPlugin="geoip_isp_maxmind GEOIP_STANDARD /pathto/GeoIPISP.dat"
#LoadPlugin="geoip_org_maxmind GEOIP_STANDARD /pathto/GeoIPOrg.dat"
[root@www ~]#

(17)
[root@www cgi-bin]# perl awstats.pl -config=www.kmvs.km.edu.tw -update
Create/Update database for config "/etc/awstats/awstats.www.kmvs.km.edu.tw.conf" by AWStats version 7.3 (build 20140126)
From data in log file "/usr/local/apache2/logs/access_log"...
Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 18592501)
Jumped lines in file: 18592501
 Found 18592501 already parsed records.
Parsed lines in file: 1205
 Found 0 dropped records,
 Found 0 comments,
 Found 0 blank records,
 Found 11 corrupted records,
 Found 0 old records,
 Found 1194 new qualified records.
[root@www cgi-bin]#

(18)
[root@www cgi-bin]# date
日 12月 28 15:09:42 CST 2014
[root@www cgi-bin]# uname -a
Linux www.kmvs.km.edu.tw 3.3.4-5.fc17.i686.PAE #1 SMP Mon May 7 17:37:39 UTC 2012 i686 i686 i386 GNU/Linux
[root@www cgi-bin]#

(19)修改排程使系統每天早上六點自動執行分析 Web Log 的工作

[root@www cgi-bin]# crontab -e
no crontab for root - using an empty one
crontab: installing new crontab
[root@www cgi-bin]# crontab -l
0 6 * * * perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.kmvs.km.edu.tw -update > /dev/null 2>&1
[root@www cgi-bin]#

(20)察看產生的awstats記錄檔
[root@www cgi-bin]# ls /var/lib/awstats -l
總計 46280
-rw-r--r-- 1 root root 1507697 12月 28 11:09 awstats012013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 3237568 12月 28 11:19 awstats012014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root  897707 12月 28 11:09 awstats022013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1152498 12月 28 11:20 awstats022014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1267021 12月 28 11:11 awstats032013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1240218 12月 28 11:20 awstats032014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1155452 12月 28 11:12 awstats042013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 3256622 12月 28 11:21 awstats042014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1278557 12月 28 11:14 awstats052013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1450563 12月 28 11:21 awstats052014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1450384 12月 28 11:15 awstats062013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1829059 12月 28 11:22 awstats062014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1277144 12月 28 11:16 awstats072013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1373670 12月 28 11:23 awstats072014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1245066 12月 28 11:16 awstats082013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1483693 12月 28 11:24 awstats082014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root  462727 12月 28 11:06 awstats092012.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1225317 12月 28 11:17 awstats092013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1358759 12月 28 11:25 awstats092014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1178654 12月 28 11:07 awstats102012.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1599425 12月 28 11:18 awstats102013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1522416 12月 28 11:26 awstats102014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root  962368 12月 28 11:07 awstats112012.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1070319 12月 28 11:18 awstats112013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1722805 12月 28 11:27 awstats112014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root  888774 12月 28 11:08 awstats122012.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 1276304 12月 28 11:19 awstats122013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root root 8958493 12月 28 15:09 awstats122014.www.kmvs.km.edu.tw.txt
[root@www cgi-bin]#


(21)修改awstats.pl的執行權限
[root@www cgi-bin]# chmod 777 /usr/local/awstats/wwwroot/cgi-bin/awstats.pl
[root@www cgi-bin]#


(22) 察看結果
http://www.kmvs.km.edu.tw/awstats/awstats.pl?config=www.kmvs.km.edu.tw

Forbidden

You don't have permission to access /awstats/awstats.pl on this server.

(23)
[root@www cgi-bin]# /usr/local/apache2/bin/httpd -v
Server version: Apache/2.4.2 (Unix)
Server built:   Sep 13 2012 17:55:08
[root@www cgi-bin]#

(24)
[root@www cgi-bin]# yum install mod_perl

:

Installed:
  mod_perl.i686 0:2.0.5-8.fc17

Dependency Installed:
  perl-BSD-Resource.i686 0:1.29.04-9.fc17                         perl-Linux-Pid.i686 0:0.04-14.fc17

Complete!
[root@www cgi-bin]#


(26)

[root@www cgi-bin]# vi /usr/local/apache2/conf/httpd.conf
[root@www cgi-bin]# cat /usr/local/apache2/conf/httpd.conf|grep mod_cgi
LoadModule cgid_module modules/mod_cgid.so
    # socket used to communicate with the CGI daemon of mod_cgid.
[root@www cgi-bin]#

[root@www cgi-bin]#  ls /usr/local/apache2/modules/|grep cgi
mod_cgid.so
mod_proxy_fcgi.so
mod_proxy_scgi.so
[root@www cgi-bin]#

(27)
[root@www cgi-bin]# chmod 777 -R /usr/local/awstats

[root@www wwwroot]# cd /usr/local/awstats/
[root@www awstats]# tree -d
.
├── docs
│   ├── images
│   └── scripts
├── tools
│   ├── nginx
│   ├── webmin
│   └── xslt
└── wwwroot
    ├── cgi-bin
    │   ├── lang
    │   │   ├── tooltips_f
    │   │   ├── tooltips_m
    │   │   └── tooltips_w
    │   ├── lib
    │   └── plugins
    │       └── example
    ├── classes
    │   └── src
    ├── css
    ├── icon
    │   ├── browser
    │   ├── clock
    │   ├── cpu
    │   ├── flags
    │   ├── mime
    │   ├── os
    │   └── other
    └── js

28 directories
[root@www awstats]#


(28)
[root@www awstats]# yum install cpan

:
Updated:
  perl-CPAN.noarch 0:1.9600.01-225.fc17

Dependency Updated:
  perl.i686 4:5.14.4-225.fc17                                  perl-CGI.noarch 0:3.52-218.fc17
  perl-Digest-MD5.i686 0:2.51-225.fc17                         perl-Digest-SHA.i686 1:5.61-225.fc17
  perl-ExtUtils-Install.noarch 0:1.56-225.fc17                 perl-ExtUtils-ParseXS.noarch 1:2.2210-225.fc17
  perl-Module-Pluggable.noarch 1:3.90-225.fc17                 perl-PathTools.i686 0:3.33-225.fc17
  perl-Pod-Escapes.noarch 1:1.04-225.fc17                      perl-Pod-Simple.noarch 1:3.16-225.fc17
  perl-Test-Harness.noarch 0:3.23-225.fc17                     perl-devel.i686 4:5.14.4-225.fc17
  perl-libs.i686 4:5.14.4-225.fc17                             perl-macros.i686 4:5.14.4-225.fc17
  perl-parent.noarch 1:0.225-225.fc17

Complete!
(29)
[root@www awstats]# perl -MCPAN -e 'install Encode'
:
Running make test
  Delayed until after prerequisites
Running make install
  Delayed until after prerequisites
Can't locate local/lib.pm in @INC (@INC contains: /root/perl5/lib/perl5 /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 /usr/local/awstats) at /usr/share/perl5/CPAN/FirstTime.pm line 1300.

(30)
[root@www awstats]# perl -MCPAN -e shell
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.960001)
Enter 'h' for help.

cpan[1]> install Test::Most
:
Running make install
Installing /usr/local/share/perl5/Test/Most.pm
Installing /usr/local/share/perl5/Test/Most/Exception.pm
Installing /usr/local/share/man/man3/Test::Most.3pm
Installing /usr/local/share/man/man3/Test::Most::Exception.3pm
Appending installation info to /usr/lib/perl5/perllocal.pod
  OVID/Test-Most-0.34.tar.gz
  /bin/make install  -- OK

cpan[2]> quit
Terminal does not support GetHistory.
Lockfile removed.

(31)
[root@www awstats]# perl -MCPAN -e 'install Encode'
:
Installing /usr/local/bin/enc2xs
Appending installation info to /usr/lib/perl5/perllocal.pod
  DANKOGAI/Encode-2.67.tar.gz
  /bin/make install  -- OK

(32)
[root@www awstats]# perl -MCPAN -e 'install URI::Escape'
Going to read '/root/.cpan/Metadata'
  Database was generated on Sun, 28 Dec 2014 07:29:02 GMT
URI::Escape is up to date (3.31).
[root@www awstats]#

(33)
[root@www www]# getenforce
Disabled
[root@www www]# vi /etc/sysconfig/selinux
[root@www www]# cat /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
# SELINUX=enforcing
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

(34) success


[root@www www]# vi /usr/local/apache2/conf/httpd.conf
:
# This is to permit URL access to scripts/files in AWStats directory.
<Directory "/usr/local/awstats/wwwroot">
   Options Indexes FollowSymLinks MultiViews
   AllowOverride All
   Require local
   Order allow,deny
#   Allow from all
   Require all granted
</Directory>

<Directory "/usr/local/awstats/wwwroot/cgi-bin">
    options ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

 

http://www.kmvs.km.edu.tw/awstats/awstats.pl?config=www.kmvs.km.edu.tw

(35)
[root@www www]# vi /etc/awstats/awstats.www.kmvs.km.edu.tw.conf
[root@www www]# cat /etc/awstats/awstats.www.kmvs.km.edu.tw.conf|grep FullY
AllowFullYearView=3
[root@www www]#

(36)
[root@www lnx]# wget http://search.cpan.org/CPAN/authors/id/B/BR/BRICAS/Geo-IPfree-1.141670.tar.gz

[root@www lnx]# cd Geo-IPfree-1.141670
[root@www Geo-IPfree-1.141670]# ls
benchmark  Changes  lib  Makefile.PL  MANIFEST  META.json  META.yml  misc  README  t
:

[root@www Geo-IPfree-1.141670]# perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for Geo::IPfree
[root@www Geo-IPfree-1.141670]# make
cp lib/Geo/ipscountry.dat blib/lib/Geo/ipscountry.dat
cp lib/Geo/IPfree.pm blib/lib/Geo/IPfree.pm
Manifying blib/man3/Geo::IPfree.3pm
[root@www Geo-IPfree-1.141670]# make install
Installing /usr/local/share/perl5/Geo/ipscountry.dat
Installing /usr/local/share/perl5/Geo/IPfree.pm
Installing /usr/local/share/man/man3/Geo::IPfree.3pm
Appending installation info to /usr/lib/perl5/perllocal.pod
[root@www Geo-IPfree-1.141670]#

ok


(37)重新分析
[root@www Geo-IPfree-1.141670]# ls /var/lib/awstats -l
總計 46296
-rw-r--r-- 1 root   root   1507697 12月 28 11:09 awstats012013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   3237568 12月 28 11:19 awstats012014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root    897707 12月 28 11:09 awstats022013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1152498 12月 28 11:20 awstats022014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1267021 12月 28 11:11 awstats032013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1240218 12月 28 11:20 awstats032014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1155452 12月 28 11:12 awstats042013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   3256622 12月 28 11:21 awstats042014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1278557 12月 28 11:14 awstats052013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1450563 12月 28 11:21 awstats052014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1450384 12月 28 11:15 awstats062013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1829059 12月 28 11:22 awstats062014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1277144 12月 28 11:16 awstats072013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1373670 12月 28 11:23 awstats072014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1245066 12月 28 11:16 awstats082013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1483693 12月 28 11:24 awstats082014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root    462727 12月 28 11:06 awstats092012.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1225317 12月 28 11:17 awstats092013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1358759 12月 28 11:25 awstats092014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1178654 12月 28 11:07 awstats102012.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1599425 12月 28 11:18 awstats102013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1522416 12月 28 11:26 awstats102014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root    962368 12月 28 11:07 awstats112012.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1070319 12月 28 11:18 awstats112013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1722805 12月 28 11:27 awstats112014.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root    888774 12月 28 11:08 awstats122012.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 root   root   1276304 12月 28 11:19 awstats122013.www.kmvs.km.edu.tw.txt
-rw-r--r-- 1 webadm webadm 8977361 12月 29 10:01 awstats122014.www.kmvs.km.edu.tw.txt
[root@www Geo-IPfree-1.141670]# cd /var/lib/awstats/
[root@www awstats]# mkdir old
[root@www awstats]# mv aw* old
[root@www awstats]# ls
old
[root@www awstats]#
[root@www awstats]# ls -l
總計 1612
-rw-r--r-- 1 webadm webadm  462956 12月 29 10:06 awstats092012.www.kmvs.km.edu.tw.tmp.6491
-rw-r--r-- 1 webadm webadm 1179339 12月 29 10:06 awstats102012.www.kmvs.km.edu.tw.tmp.6491
drwxr-xr-x 2 root   root      4096 12月 29 10:05 old
[root@www awstats]# ps ax|grep 6491
 6491 ?        R      1:41 /usr/bin/perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl
 6503 pts/0    S+     0:00 grep --color=auto 6491
[root@www awstats]#


select id,article_id,topic,text from lt_articles_text where article_id =313; ok. update lt_articles set num_reads=num_reads +1 where id=313; ok.