(1) [root@localhost webadm]# wget http://prdownloads.sourceforge.net/awstats/awstats-7.3.tar.gz 2014-12-11 15:22:25 (9.20 KB/s) - ‘awstats-7.3.tar.gz’ saved [2897463/2897463]
(2) [root@localhost webadm]# tar xvzf awstats-7.3.tar.gz [root@localhost webadm]# cd awstats-7.3/ [root@localhost awstats-7.3]# ls docs README.TXT tools wwwroot
(3) [root@localhost tools]# pwd /home/webadm/awstats-7.3/tools [root@localhost tools]# perl awstats_configure.pl : -----> Running OS detected: Linux, BSD or Unix Warning: AWStats standard directory on Linux OS is '/usr/local/awstats'. If you want to use standard directory, you should first move all content of AWStats distribution from current directory: /home/webadm/awstats-7.3 to standard directory: /usr/local/awstats :
(4) [root@localhost webadm]# mv /home/webadm/awstats-7.3 /usr/local/awstats [root@localhost webadm]# ls /usr/local/awstats docs README.TXT tools wwwroot [root@localhost webadm]#
(5) [root@localhost webadm]# cd /usr/local/awstats/tools/ [root@localhost 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' All AWStats directives are already present.
-----> 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: > insecta.idv.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): > /etc/awstats7.3
-----> Create config file '/etc/awstats7.3/awstats.insecta.idv.tw.conf' Config file /etc/awstats7.3/awstats.insecta.idv.tw.conf created.
-----> 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=insecta.idv.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/awstats7.3/awstats.insecta.idv.tw.conf You should have a look inside to check and change manually main parameters. You can then manually update your statistics for 'insecta.idv.tw' with command: > perl awstats.pl -update -config=insecta.idv.tw You can also read your statistics for 'insecta.idv.tw' with URL: > http://localhost/awstats/awstats.pl?config=insecta.idv.tw
Press ENTER to finish...
[root@localhost tools]#
(6) [root@localhost awstats]# 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@localhost awstats]#
(7) [root@localhost awstats]# cat /usr/local/apache2/conf/httpd.conf : 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 Indexes FollowSymLinks MultiViews AllowOverride All Require local Order allow,deny Allow from all </Directory>
(8) [root@localhost awstats]# cat /etc/awstats7.3/awstats.insecta.idv.tw.conf
(9) [root@localhost awstats]# vi /etc/awstats7.3/awstats.insecta.idv.tw.conf [root@localhost awstats]# cat /etc/awstats7.3/awstats.insecta.idv.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@localhost awstats]#
(10) [root@localhost awstats]# cat /etc/awstats7.3/awstats.insecta.idv.tw.conf|grep LogType LogType=W [root@localhost awstats]#
(11) [root@localhost awstats]# cat /etc/awstats7.3/awstats.insecta.idv.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@localhost awstats]#
(12) [root@localhost awstats]# cat /etc/awstats7.3/awstats.insecta.idv.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="insecta.idv.tw" # You can repeat the "SiteDomain" value in this list. [root@localhost awstats]#
(13) [root@localhost cgi-bin]# pwd /usr/local/awstats/wwwroot/cgi-bin [root@localhost cgi-bin]# ls awdownloadcsv.pl awredir.pl awstats.model.conf awstats.pl lang lib plugins [root@localhost cgi-bin]#
(14) [root@localhost cgi-bin]# perl awstats.pl -config=insecta.idv.tw -update Create/Update database for config "/etc/awstats/awstats.insecta.idv.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 364653) Jumped lines in file: 364653 Found 364653 already parsed records. Parsed lines in file: 46966 Found 1 dropped records, Found 0 comments, Found 0 blank records, Found 10607 corrupted records, Found 0 old records, Found 36358 new qualified records. [root@localhost cgi-bin]#
(15) [root@localhost cgi-bin]# cat /etc/awstats7.3/awstats.insecta.idv.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@localhost cgi-bin]#
(16) [root@localhost cgi-bin]# perl awstats.pl -config=insecta.idv.tw -update -staticlinks > awstats.insecta.idv.tw.html [root@localhost cgi-bin]# [root@localhost cgi-bin]# mv awstats.insecta.idv.tw.html /usr/local/apache2/htdocs/ [root@localhost cgi-bin]# chmod 755 /usr/local/apache2/htdocs/awstats.insecta.idv.tw.html [root@localhost cgi-bin]# pwd /usr/local/awstats/wwwroot/cgi-bin [root@localhost cgi-bin]# [root@localhost cgi-bin]# cat /usr/local/apache2/htdocs/awstats.insecta.idv.tw.html Create/Update database for config "/etc/awstats/awstats.insecta.idv.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 411619) Jumped lines in file: 411619 Found 411619 already parsed records. Parsed lines in file: 4539 Found 0 dropped records, Found 0 comments, Found 0 blank records, Found 1128 corrupted records, Found 0 old records, Found 3411 new qualified records. [root@localhost cgi-bin]#
(17)
[root@localhost ~]# ls /usr/local/awstats/wwwroot/cgi-bin -l 總計 760 -rwxr-xr-x 1 webadm webadm 5076 1月 28 2014 awdownloadcsv.pl -rwxr-xr-x 1 webadm webadm 8643 1月 29 2014 awredir.pl -rw-r--r-- 1 root root 61909 12月 11 15:42 awstats.model.conf -rwxr-xr-x 1 webadm webadm 677688 1月 29 2014 awstats.pl drwxr-xr-x 5 webadm webadm 4096 11月 4 2013 lang drwxr-xr-x 2 webadm webadm 4096 12月 1 2013 lib drwxr-xr-x 3 webadm webadm 4096 1月 29 2014 plugins [root@localhost ~]#
(18)
[root@localhost ~]# cat /etc/awstats/awstats.insecta.idv.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@localhost ~]# cat /etc/awstats/awstats.insecta.idv.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 %refererquo t %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@localhost ~]# cat /etc/awstats/awstats.insecta.idv.tw.conf|grep DNSLookup # 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 DNSLookup=1 # 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@localhost ~]# cat /etc/awstats/awstats.insecta.idv.tw.conf|grep LoadPlugin # Uncomment LoadPlugin lines to enable a plugin after checking that perl #LoadPlugin="tooltips" LoadPlugin="decodeutfkeys" #LoadPlugin="ipv6" #LoadPlugin="hashfiles" #LoadPlugin="geoip GEOIP_STANDARD /pathto/GeoIP.dat" #LoadPlugin="geoipfree" #LoadPlugin="geoip_region_maxmind GEOIP_STANDARD /pathto/GeoIPRegion.dat" #LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /pathto/GeoIPCity.dat" #LoadPlugin="geoip_isp_maxmind GEOIP_STANDARD /pathto/GeoIPISP.dat" #LoadPlugin="geoip_org_maxmind GEOIP_STANDARD /pathto/GeoIPOrg.dat" #LoadPlugin="userinfo" #LoadPlugin="hostinfo" #LoadPlugin="clusterinfo" #LoadPlugin="urlalias" #LoadPlugin="timehires" #LoadPlugin="timezone +2" #LoadPlugin="rawlog" #LoadPlugin="graphapplet /awstatsclasses" MENTAL FEATURE [root@localhost ~]# cat /etc/awstats/awstats.insecta.idv.tw.conf|grep AllowFullY earView AllowFullYearView=3 [root@localhost ~]#
(19) [root@localhost ~]# perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=insecta.idv.tw Create/Update database for config "/etc/awstats/awstats.insecta.idv.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 416158) Jumped lines in file: 416158 Found 416158 already parsed records. Parsed lines in file: 40413 Found 0 dropped records, Found 0 comments, Found 0 blank records, Found 11184 corrupted records, Found 0 old records, Found 29229 new qualified records. [root@localhost ~]#
[root@localhost ~]# date 五 12月 19 08:55:34 CST 2014 [root@localhost ~]# uname -a Linux localhost.localdomain 3.14.19-100.fc19.i686.PAE #1 SMP Wed Sep 17 22:23:56 UTC 2014 i686 i686 i386 GNU/Linux [root@localhost ~]#
(20)修改排程使系統每天早上六點自動執行分析 Web Log 的工作 [root@localhost ~]# crontab -e no crontab for root - using an empty one crontab: installing new crontab [root@localhost ~]# crontab -l 0 6 * * * perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=insecta.idv.tw -update > /dev/null 2>&1 [root@localhost ~]#
(21)察看產生的awstats記錄檔 [root@localhost ~]# ls /var/lib/awstats -l 總計 91928 -rw-r--r-- 1 root root 692072 12月 5 08:32 awstats012009.insecta.idv.tw.txt -rw-r--r-- 1 root root 958904 12月 5 08:32 awstats012010.insecta.idv.tw.txt -rw-r--r-- 1 root root 1179580 12月 5 08:32 awstats012011.insecta.idv.tw.txt -rw-r--r-- 1 root root 387731 12月 5 08:32 awstats012012.insecta.idv.tw.txt -rw-r--r-- 1 root root 533681 12月 5 08:32 awstats012013.insecta.idv.tw.txt -rw-r--r-- 1 root root 836666 12月 5 08:32 awstats012014.insecta.idv.tw.txt -rw-r--r-- 1 root root 686036 12月 5 08:32 awstats022009.insecta.idv.tw.txt -rw-r--r-- 1 root root 714026 12月 5 08:32 awstats022010.insecta.idv.tw.txt -rw-r--r-- 1 root root 1108492 12月 5 08:32 awstats022011.insecta.idv.tw.txt -rw-r--r-- 1 root root 517330 12月 5 08:32 awstats022012.insecta.idv.tw.txt -rw-r--r-- 1 root root 78565 12月 5 08:32 awstats022013.insecta.idv.tw.txt -rw-r--r-- 1 root root 703106 12月 5 08:32 awstats022014.insecta.idv.tw.txt -rw-r--r-- 1 root root 960450 12月 5 08:32 awstats032009.insecta.idv.tw.txt -rw-r--r-- 1 root root 1143565 12月 5 08:32 awstats032010.insecta.idv.tw.txt -rw-r--r-- 1 root root 1704609 12月 5 08:32 awstats032011.insecta.idv.tw.txt -rw-r--r-- 1 root root 701225 12月 5 08:32 awstats032012.insecta.idv.tw.txt -rw-r--r-- 1 root root 140245 12月 5 08:32 awstats032013.insecta.idv.tw.txt -rw-r--r-- 1 root root 811806 12月 5 08:32 awstats032014.insecta.idv.tw.txt -rw-r--r-- 1 root root 1602099 12月 5 08:32 awstats042009.insecta.idv.tw.txt -rw-r--r-- 1 root root 1786833 12月 5 08:32 awstats042010.insecta.idv.tw.txt -rw-r--r-- 1 root root 1256438 12月 5 08:32 awstats042011.insecta.idv.tw.txt -rw-r--r-- 1 root root 799791 12月 5 08:32 awstats042012.insecta.idv.tw.txt -rw-r--r-- 1 root root 2796334 12月 5 08:32 awstats042013.insecta.idv.tw.txt -rw-r--r-- 1 root root 94767 12月 5 08:32 awstats042014.insecta.idv.tw.tmp.16972 -rw-r--r-- 1 root root 416910 12月 5 08:32 awstats042014.insecta.idv.tw.txt -rw-r--r-- 1 root root 2057362 12月 5 08:32 awstats052009.insecta.idv.tw.txt -rw-r--r-- 1 root root 2493538 12月 5 08:32 awstats052010.insecta.idv.tw.txt -rw-r--r-- 1 root root 1136685 12月 5 08:32 awstats052011.insecta.idv.tw.txt -rw-r--r-- 1 root root 805055 12月 5 08:32 awstats052012.insecta.idv.tw.txt -rw-r--r-- 1 root root 5745144 12月 5 08:32 awstats052013.insecta.idv.tw.txt -rw-r--r-- 1 root root 845052 12月 5 08:32 awstats052014.insecta.idv.tw.txt -rw-r--r-- 1 root root 1911232 12月 5 08:32 awstats062009.insecta.idv.tw.txt -rw-r--r-- 1 root root 1865002 12月 5 08:32 awstats062010.insecta.idv.tw.txt -rw-r--r-- 1 root root 1280038 12月 5 08:32 awstats062011.insecta.idv.tw.txt -rw-r--r-- 1 root root 698847 12月 5 08:32 awstats062012.insecta.idv.tw.txt -rw-r--r-- 1 root root 1732031 12月 5 08:32 awstats062013.insecta.idv.tw.txt -rw-r--r-- 1 root root 637499 12月 5 08:32 awstats062014.insecta.idv.tw.txt -rw-r--r-- 1 root root 2324327 12月 5 08:32 awstats072009.insecta.idv.tw.txt -rw-r--r-- 1 root root 1930765 12月 5 08:32 awstats072010.insecta.idv.tw.txt -rw-r--r-- 1 root root 1735680 12月 5 08:32 awstats072011.insecta.idv.tw.txt -rw-r--r-- 1 root root 759123 12月 5 08:32 awstats072012.insecta.idv.tw.txt -rw-r--r-- 1 root root 333142 12月 5 08:32 awstats072013.insecta.idv.tw.txt -rw-r--r-- 1 root root 2118696 12月 5 08:32 awstats072014.insecta.idv.tw.txt -rw-r--r-- 1 root root 234618 12月 5 08:32 awstats082008.insecta.idv.tw.txt -rw-r--r-- 1 root root 1979914 12月 5 08:32 awstats082009.insecta.idv.tw.txt -rw-r--r-- 1 root root 1664429 12月 5 08:32 awstats082010.insecta.idv.tw.txt -rw-r--r-- 1 root root 1464442 12月 5 08:32 awstats082011.insecta.idv.tw.txt -rw-r--r-- 1 root root 768967 12月 5 08:32 awstats082012.insecta.idv.tw.txt -rw-r--r-- 1 root root 1190160 12月 5 08:32 awstats082013.insecta.idv.tw.txt -rw-r--r-- 1 root root 8192 12月 5 08:32 awstats082014.insecta.idv.tw.tmp.11793 -rw-r--r-- 1 root root 0 12月 5 08:32 awstats082014.insecta.idv.tw.tmp.21367 -rw-r--r-- 1 root root 0 12月 5 08:32 awstats082014.insecta.idv.tw.tmp.21924 -rw-r--r-- 1 root root 4096 12月 5 08:32 awstats082014.insecta.idv.tw.tmp.8913 -rw-r--r-- 1 root root 59494 12月 5 08:32 awstats082014.insecta.idv.tw.txt -rw-r--r-- 1 root root 1027005 12月 5 08:32 awstats092008.insecta.idv.tw.txt -rw-r--r-- 1 root root 1505939 12月 5 08:32 awstats092009.insecta.idv.tw.txt -rw-r--r-- 1 root root 1952415 12月 5 08:32 awstats092010.insecta.idv.tw.txt -rw-r--r-- 1 root root 977692 12月 5 08:32 awstats092011.insecta.idv.tw.txt -rw-r--r-- 1 root root 705593 12月 5 08:32 awstats092012.insecta.idv.tw.txt -rw-r--r-- 1 root root 741386 12月 5 08:32 awstats092013.insecta.idv.tw.txt -rw-r--r-- 1 root root 14549 12月 5 08:37 awstats092014.insecta.idv.tw.txt -rw-r--r-- 1 root root 807608 12月 5 08:32 awstats102008.insecta.idv.tw.txt -rw-r--r-- 1 root root 1711409 12月 5 08:32 awstats102009.insecta.idv.tw.txt -rw-r--r-- 1 root root 1664245 12月 5 08:32 awstats102010.insecta.idv.tw.txt -rw-r--r-- 1 root root 1030248 12月 5 08:32 awstats102011.insecta.idv.tw.txt -rw-r--r-- 1 root root 831923 12月 5 08:32 awstats102012.insecta.idv.tw.txt -rw-r--r-- 1 root root 116927 12月 5 08:32 awstats102013.insecta.idv.tw.txt -rw-r--r-- 1 root root 787756 12月 5 12:26 awstats102014.insecta.idv.tw3.txt -rw-r--r-- 1 root root 821293 12月 5 09:20 awstats102014.insecta.idv.tw.txt -rw-r--r-- 1 root root 781808 12月 5 08:32 awstats112008.insecta.idv.tw.txt -rw-r--r-- 1 root root 1603964 12月 5 08:32 awstats112009.insecta.idv.tw.txt -rw-r--r-- 1 root root 1984891 12月 5 08:32 awstats112010.insecta.idv.tw.txt -rw-r--r-- 1 root root 665792 12月 5 08:32 awstats112011.insecta.idv.tw.txt -rw-r--r-- 1 root root 952421 12月 5 08:32 awstats112012.insecta.idv.tw.txt -rw-r--r-- 1 root root 429103 12月 5 08:32 awstats112013.insecta.idv.tw.tmp.9690 -rw-r--r-- 1 root root 599658 12月 5 08:32 awstats112013.insecta.idv.tw.txt -rw-r--r-- 1 root root 1233985 12月 5 12:26 awstats112014.insecta.idv.tw3.txt -rw-r--r-- 1 root root 1287233 12月 5 10:09 awstats112014.insecta.idv.tw.txt -rw-r--r-- 1 root root 699771 12月 5 08:32 awstats122008.insecta.idv.tw.txt -rw-r--r-- 1 root root 3869527 12月 5 08:32 awstats122009.insecta.idv.tw.txt -rw-r--r-- 1 root root 1670424 12月 5 08:32 awstats122010.insecta.idv.tw.txt -rw-r--r-- 1 root root 492706 12月 5 08:32 awstats122011.insecta.idv.tw.txt -rw-r--r-- 1 root root 580960 12月 5 08:32 awstats122012.insecta.idv.tw.txt -rw-r--r-- 1 root root 0 12月 5 08:32 awstats122013.insecta.idv.tw.tmp.21800 -rw-r--r-- 1 root root 4096 12月 5 08:32 awstats122013.insecta.idv.tw.tmp.25950 -rw-r--r-- 1 root root 753729 12月 5 08:32 awstats122013.insecta.idv.tw.txt -rw-r--r-- 1 root root 340477 12月 5 12:26 awstats122014.insecta.idv.tw3.txt -rw-r--r-- 1 root root 888258 12月 19 08:54 awstats122014.insecta.idv.tw.txt drwxr-xr-x 2 root root 4096 12月 5 08:32 backup -rw-r--r-- 1 root root 23724 12月 19 08:54 dnscachelastupdate.insecta.idv.tw.txt [root@localhost ~]#
(22)修改awstats.pl的執行權限 [root@localhost ~]# chmod 777 /usr/local/awstats/wwwroot/cgi-bin/awstats.pl [root@localhost ~]#
(23) 察看結果 http://insecta.idv.tw/awstats/awstats.pl?config=insecta.idv.tw Forbidden You don't have permission to access /awstats/awstats.pl on this server.
[root@localhost ~]# cat /var/lib/awstats/awstats122014.insecta.idv.tw.txt : /wiki/index.php/%E7%89%B9%E6%AE%8A:WhatLinksHere/20090418%E5%AE%9C%E8%98%AD%E7%B8%A3%E4%B8%89%E6%98%9F%E9%84%89%E4%BD%95%E6%B0%8F%E5%8E%9F%E7%94%9F%E8%97%A5%E8%8D%89%E5%9C%92 1 32145 0 0 /wiki/images/thumb/c/c1/20090118%E5%AE%9C%E8%98%AD%E9%A0%AD%E5%9F%8E%E6%96%B0%E5%B3%B0%E7%80%91%E5%B8%83%E6%9C%AA%E7%9F%A5%E4%BC%BC%E5%AE%89%E5%BE%B7%E9%81%9C%E8%A0%85%E8%99%8E1d.JPG/ 1 1171 0 0 /moodle/theme/image.php/_s/clean/core/1416352720/a/setting 5 1805 0 0 END_SIDER
(24) [root@localhost ~]# /usr/local/apache2/bin/httpd -v Server version: Apache/2.4.10 (Unix) Server built: Oct 9 2014 07:24:24 [root@localhost ~]# [root@localhost ~]# cd /usr/local/apache2/logs/ [root@localhost logs]# ls access_log error_log httpd.pid [root@localhost logs]# mv error_log error_log.141219 [root@localhost logs]# mv access_log access_log.141219
[root@localhost logs]# ls -l 總計 619276 -rw-r--r--. 1 root root 113325184 12月 19 09:47 access_log.141219 -rw-r--r--. 1 root root 520798119 12月 19 09:45 error_log.141219 -rw-r--r-- 1 root root 6 12月 19 09:45 httpd.pid
[root@localhost logs]# /usr/local/apache2/bin/apachectl stop
[root@localhost logs]# /usr/local/apache2/bin/apachectl start
[root@localhost logs]# ls -l 總計 619288 -rw-r--r-- 1 root root 264 12月 19 09:48 access_log -rw-r--r--. 1 root root 113327810 12月 19 09:47 access_log.141219 -rw-r--r-- 1 root root 559 12月 19 09:47 error_log -rw-r--r--. 1 root root 520798802 12月 19 09:47 error_log.141219 -rw-r--r-- 1 root root 6 12月 19 09:47 httpd.pid [root@localhost logs]# cat access_log 66.249.67.30 - - [19/Dec/2014:09:48:00 +0800] "GET /wiki/index.php/%E5%9C%96%E7%89%87:20090325%E5%8D%97%E6%B9%96%E5%A4%A7%E5%B1%B1%E5%8B%9D%E5%85%89%E9%98%B2%E7%81%AB%E5%B7%B7%E6%9C%AA%E7%9F%A5%E6%98%86%E8%9F%B21a.JPG HTTP/1.1" 200 16479 "-" "Googlebot-Image/1.0" [root@localhost logs]# cat error_log PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-zts-20100525/imagick.so' - /usr/local/lib/php/extensions/no-debug-zts-20100525/imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0 [Fri Dec 19 09:47:58.023025 2014] [mpm_event:notice] [pid 22273:tid 3077961408] AH00489: Apache/2.4.10 (Unix) PHP/5.4.34 configured -- resuming normal operations [Fri Dec 19 09:47:58.023092 2014] [core:notice] [pid 22273:tid 3077961408] AH00094: Command line: '/usr/local/apache2/bin/httpd' [root@localhost logs]#
[root@localhost logs]# cat error_log : [Fri Dec 19 09:49:43.503200 2014] [:error] [pid 22359:tid 2975820608] [client 36.248.117.88:60286] PHP Warning: Cannot modify header information - headers already sent by (output started at /usr/local/apache2/htdocs/lf/class/logger/loggermanager.class.php:140) in /usr/local/apache2/htdocs/lf/plugins/badbehavior/bad-behavior/screener.inc.php on line 8 [Fri Dec 19 09:49:43.508048 2014] [:error] [pid 22359:tid 2975820608] [client 36.248.117.88:60286] PHP Strict Standards: Declaration of UserStatus::getStatusList() should be compatible with GenericStatusList::getStatusList($prefix, $statusAllId, $includeStatusAll = false) in /usr/local/apache2/htdocs/lf/class/dao/userstatus.class.php on line 17 [Fri Dec 19 09:49:43.510581 2014] [:error] [pid 22359:tid 2975820608] [client 36.248.117.88:60286] PHP Deprecated: Assigning the return value of new by reference is deprecated in /usr/local/apache2/htdocs/lf/class/plugin/pluginmanager.class.php on line 247 [Fri Dec 19 09:49:43.515725 2014] [:error] [pid 22359:tid 2975820608] [client 36.248.117.88:60286] PHP Fatal error: Cannot redeclare class Locale in /usr/local/apache2/htdocs/lf/class/locale/locale.class.php on line 79
[Fri Dec 19 09:51:06.204418 2014] [authz_core:error] [pid 22359:tid 2891893568] [client 163.25.20.90:49663] AH01630: client denied by server configuration: /usr/local/awstats/wwwroot/cgi-bin/awstats.pl, referer: http://insecta.idv.tw/wiki/index.php/%E7%B6%AD%E8%AD%B7%E8%A8%98%E9%8C%84
[root@localhost logs]# ls access_log access_log.141219 error_log error_log.141219 httpd.pid [root@localhost logs]# ls -l 總計 619332 -rw-r--r-- 1 root root 11472 12月 19 09:53 access_log -rw-r--r--. 1 root root 113327810 12月 19 09:47 access_log.141219 -rw-r--r-- 1 root root 38403 12月 19 09:53 error_log -rw-r--r--. 1 root root 520798802 12月 19 09:47 error_log.141219 -rw-r--r-- 1 root root 6 12月 19 09:47 httpd.pid
(25) [root@localhost htdocs]# yum install mod_perl : Installed: mod_perl.i686 0:2.0.7-12.20130221svn1448242.fc19 : Complete!
(26) ok [root@localhost ~]# cat /usr/local/apache2/conf/httpd.conf|grep mod_cgi LoadModule cgid_module modules/mod_cgid.so #LoadModule cgi_module modules/mod_cgi.so # socket used to communicate with the CGI daemon of mod_cg d.
[root@localhost ~]# ls /usr/local/apache2/modules/|grep cgi mod_cgid.so mod_proxy_fcgi.so mod_proxy_scgi.so [root@localhost ~]#
(27) Error: Plugin load for plugin 'decodeutfkeys' failed with return code: Error: Can't locate URI/Escape.pm in @INC (@INC contains: /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/wwwroot/cgi-bin/lib /usr/local/awstats/wwwroot/cgi-bin/plugins) at (eval 5) line 1.
(28) [root@localhost awstats]# vi /etc/awstats7.3/awstats.insecta.idv.tw.conf [root@localhost awstats]# cat /etc/awstats7.3/awstats.insecta.idv.tw.conf|grep decodeutfkeys LoadPlugin="decodeutfkeys" [root@localhost awstats]#
(29) [root@localhost awstats]# ls docs README.TXT tools wwwroot [root@localhost 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@localhost awstats]# pwd /usr/local/awstats [root@localhost awstats]#
(30) [root@localhost webadm]# wget http://search.cpan.org/CPAN/authors/id/E/ET/ETHER/URI-1.65.tar.gz --2014-12-28 08:02:16-- http://search.cpan.org/CPAN/authors/id/E/ET/ETHER/URI-1.65.tar.gz 正在查找主機 search.cpan.org (search.cpan.org)... 207.171.7.49, 207.171.7.59 正在連接 search.cpan.org (search.cpan.org)|207.171.7.49|:80... 連上了。 已送出 HTTP 要求,正在等候回應... 302 Found 位置: http://www.cpan.org/authors/id/E/ET/ETHER/URI-1.65.tar.gz [跟隨至新的 URL] --2014-12-28 08:02:22-- http://www.cpan.org/authors/id/E/ET/ETHER/URI-1.65.tar.gz 正在查找主機 www.cpan.org (www.cpan.org)... 94.242.223.198, 207.171.7.91, 2607:f238:3::91:1 正在連接 www.cpan.org (www.cpan.org)|94.242.223.198|:80... 連上了。 已送出 HTTP 要求,正在等候回應... 200 OK 長度: 82882 (81K) [application/x-gzip] Saving to: ‘URI-1.65.tar.gz’
100%[=================================================>] 82,882 89.6KB/s in 0.9s
2014-12-28 08:02:23 (89.6 KB/s) - ‘URI-1.65.tar.gz’ saved [82882/82882]
[root@localhost webadm]# [root@localhost webadm]# tar xvzf URI-1.65.tar.gz
[root@localhost URI-1.65]# ls Changes Makefile.PL MANIFEST META.json META.yml README t URI URI.pm uri-test [root@localhost URI-1.65]# cat README This package contains the URI.pm module with friends. The module implements the URI class. Objects of this class represent Uniform Resource Identifier references as specified in RFC 2396 and updated by RFC 2732.
URI objects can be used to access and manipulate the various components that make up these strings. There are also methods to combine URIs in various ways.
Some tests require an Internet connection to work and are skipped if one is not active.
You need perl-5.8.1 or better to install this package. You should also have the MIME::Base64 module installed. Installation is otherwise as usual:
perl Makefile.PL make make test make install
Questions about how to use this library should be directed to the comp.lang.perl.modules USENET Newsgroup. Bug reports and suggestions for improvements can be sent to the <libwww@perl.org> mailing list.
Copyright 1998-2009 Gisle Aas. Copyright 1998 Graham Barr.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. [root@localhost URI-1.65]# [root@localhost URI-1.65]# perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for URI [root@localhost URI-1.65]# make : cp URI/file/Mac.pm blib/lib/URI/file/Mac.pm Manifying blib/man3/URI::WithBase.3pm Manifying blib/man3/URI::URL.3pm Manifying blib/man3/URI.3pm Manifying blib/man3/URI::_punycode.3pm Manifying blib/man3/URI::file.3pm Manifying blib/man3/URI::Split.3pm Manifying blib/man3/URI::data.3pm Manifying blib/man3/URI::ldap.3pm Manifying blib/man3/URI::Escape.3pm Manifying blib/man3/URI::QueryParam.3pm Manifying blib/man3/URI::Heuristic.3pm [root@localhost URI-1.65]# make test : Parse errors: No plan found in TAP output Files=39, Tests=472, 1 wallclock secs ( 0.07 usr 0.02 sys + 0.33 cusr 0.02 csys = 0.44 CPU) Result: FAIL Failed 11/39 test programs. 0/472 subtests failed. make: *** [test_dynamic] Error 2 [root@localhost URI-1.65]#
(31) [root@localhost webadm]# wget http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/URI-1.60.tar.gz
: 2014-12-28 08:15:26 (171 KB/s) - ‘URI-1.60.tar.gz’ saved [81196/81196] [root@localhost webadm]# tar xvzf URI-1.60.tar.gz
[root@localhost webadm]# cd URI-1.60 [root@localhost URI-1.60]# ls Changes Makefile.PL MANIFEST META.yml README t URI URI.pm uri-test [root@localhost URI-1.60]# cat README This package contains the URI.pm module with friends. The module implements the URI class. Objects of this class represent Uniform Resource Identifier references as specified in RFC 2396 and updated by RFC 2732.
URI objects can be used to access and manipulate the various components that make up these strings. There are also methods to combine URIs in various ways.
Some tests require an Internet connection to work and are skipped if one is not active.
You need perl-5.8.1 or better to install this package. You should also have the MIME::Base64 module installed. Installation is otherwise as usual:
perl Makefile.PL make make test make install
Questions about how to use this library should be directed to the comp.lang.perl.modules USENET Newsgroup. Bug reports and suggestions for improvements can be sent to the <libwww@perl.org> mailing list.
Copyright 1998-2009 Gisle Aas. Copyright 1998 Graham Barr.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. [root@localhost URI-1.60]#
[root@localhost URI-1.60]# perl Makefile.PL Checking if your kit is complete... Looks good Warning: prerequisite Test::More 0 not found. Writing Makefile for URI [root@localhost URI-1.60]# make [root@localhost URI-1.60]# make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/abs.t .......... ok t/clone.t ........ ok t/cwd.t .......... ok t/data.t ......... ok t/escape.t ....... Can't locate Test/More.pm in @INC (@INC contains: /home/webadm/URI-1.60/blib/lib /home/webadm/URI-1.60/blib/arch /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at t/escape.t line 6. BEGIN failed--compilation aborted at t/escape.t line 6. t/escape.t ....... Dubious, test returned 2 (wstat 512, 0x200) No subtests run t/file.t ......... ok t/ftp.t .......... ok t/generic.t ...... ok t/gopher.t ....... ok t/heuristic.t .... ok t/http.t ......... ok :
t/utf8.t ......... Can't locate Test/More.pm in @INC (@INC contains: /home/webadm/URI-1.60/blib/lib /home/webadm/URI-1.60/blib/arch /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at t/utf8.t line 8. BEGIN failed--compilation aborted at t/utf8.t line 8. t/utf8.t ......... Dubious, test returned 2 (wstat 512, 0x200) No subtests run
Test Summary Report ------------------- t/escape.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/idna.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/iri.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/num_eq.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/punycode.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/query-param.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/query.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/rfc2732.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/utf8.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output Files=38, Tests=479, 0 wallclock secs ( 0.08 usr 0.02 sys + 0.50 cusr 0.05 csys = 0.65 CPU) Result: FAIL Failed 9/38 test programs. 0/479 subtests failed. make: *** [test_dynamic] Error 2 [root@localhost URI-1.60]#
(32) cpan:[root@localhost URI-1.60]# yum install cpan Loaded plugins: langpacks, refresh-packagekit Resolving Dependencies --> Running transaction check ---> Package perl-CPAN.noarch 0:1.9800-266.fc19 will be installed --> Processing Dependency: perl(Digest::SHA) for package: perl-CPAN-1.9800-266.fc19.noarch --> Running transaction check ---> Package perl-Digest-SHA.i686 1:5.85-2.fc19 will be installed --> Processing Dependency: perl(Digest::base) for package: 1:perl-Digest-SHA-5.85-2.fc19.i686 --> Running transaction check ---> Package perl-Digest.noarch 0:1.17-244.fc19 will be installed --> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================== Package Arch Version Repository Size =========================================================================================== Installing: perl-CPAN noarch 1.9800-266.fc19 updates 289 k Installing for dependencies: perl-Digest noarch 1.17-244.fc19 fedora 23 k perl-Digest-SHA i686 1:5.85-2.fc19 updates 57 k
Transaction Summary =========================================================================================== Install 1 Package (+2 Dependent packages)
Total download size: 369 k Installed size: 881 k Is this ok [y/d/N]: y Downloading packages: (1/3): perl-Digest-1.17-244.fc19.noarch.rpm | 23 kB 00:00:00 (2/3): perl-Digest-SHA-5.85-2.fc19.i686.rpm | 57 kB 00:00:00 (3/3): perl-CPAN-1.9800-266.fc19.noarch.rpm | 289 kB 00:00:00 ------------------------------------------------------------------------------------------- Total 813 kB/s | 369 kB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : perl-Digest-1.17-244.fc19.noarch 1/3 Installing : 1:perl-Digest-SHA-5.85-2.fc19.i686 2/3 Installing : perl-CPAN-1.9800-266.fc19.noarch 3/3 Verifying : perl-CPAN-1.9800-266.fc19.noarch 1/3 Verifying : perl-Digest-1.17-244.fc19.noarch 2/3 Verifying : 1:perl-Digest-SHA-5.85-2.fc19.i686 3/3
Installed: perl-CPAN.noarch 0:1.9800-266.fc19
Dependency Installed: perl-Digest.noarch 0:1.17-244.fc19 perl-Digest-SHA.i686 1:5.85-2.fc19
Complete! [root@localhost URI-1.60]#
(33) [root@localhost URI-1.60]# perl -MCPAN -e 'install Encode' : Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for local::lib Writing MYMETA.yml and MYMETA.json ---- Unsatisfied dependencies detected during ---- ---- HAARG/local-lib-2.000015.tar.gz ---- Test::More [build_requires] 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 /home/webadm/URI-1.60) at /usr/share/perl5/CPAN/FirstTime.pm line 1300.
(34) [root@localhost URI-1.60]# perl -MCPAN -e 'install URI::Escape' Reading '/root/.cpan/Metadata' Database was generated on Sat, 27 Dec 2014 23:53:29 GMT URI::Escape is up to date (3.31). [root@localhost URI-1.60]#
[root@localhost URI-1.60]# perl -MCPAN -e shell cpan[3]> install URI::Escape : t/utf8warnings.t ........... Can't locate Test/More.pm in @INC (@INC contains: /root/.cpan/build/Encode-2.67-PFYuYO/blib/lib /root/.cpan/build/Encode-2.67-PFYuYO/blib/arch /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at t/utf8warnings.t line 11. BEGIN failed--compilation aborted at t/utf8warnings.t line 11. t/utf8warnings.t ........... Dubious, test returned 2 (wstat 512, 0x200) No subtests run : Running make install make test had returned bad status, won't install without force Failed during this command: DANKOGAI/Encode-2.67.tar.gz : make_test NO
cpan[4]> quit Terminal does not support GetHistory. Lockfile removed.
(35) [root@localhost URI-1.60]# perl -v
This is perl 5, version 16, subversion 3 (v5.16.3) built for i386-linux-thread-multi
Copyright 1987-2012, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.
[root@localhost URI-1.60]#
(36)
[root@localhost URI-1.60]# perl -MTest::Most -e 1 Can't locate Test/Most.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .). BEGIN failed--compilation aborted.
[root@localhost URI-1.60]# perl -MCPAN -e shell cpan[1]> install Test::Most : All tests successful. Files=16, Tests=88, 1 wallclock secs ( 0.04 usr 0.00 sys + 0.60 cusr 0.04 csys = 0.68 CPU) Result: PASS OVID/Test-Most-0.34.tar.gz /usr/bin/make test -- OK 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::Exception.3pm Installing /usr/local/share/man/man3/Test::Most.3pm Appending installation info to /usr/lib/perl5/perllocal.pod OVID/Test-Most-0.34.tar.gz /usr/bin/make install -- OK cpan[2]> quit Terminal does not support GetHistory. Lockfile removed.
(37) [root@localhost URI-1.60]# perl -MCPAN -e 'install Encode' : DANKOGAI/Encode-2.67.tar.gz /usr/bin/make install -- OK [root@localhost URI-1.60]# [root@localhost URI-1.60]# perl -MCPAN -e 'install URI::Escape' Reading '/root/.cpan/Metadata' Database was generated on Sat, 27 Dec 2014 23:53:29 GMT URI::Escape is up to date (3.31). [root@localhost URI-1.60]# [root@localhost URI-1.60]# perl -MCPAN -e shell Terminal does not support AddHistory.
cpan shell -- CPAN exploration and modules installation (v1.9800) Enter 'h' for help.
cpan[1]> install URI::Escape Reading '/root/.cpan/Metadata' Database was generated on Sat, 27 Dec 2014 23:53:29 GMT URI::Escape is up to date (3.31).
cpan[2]>
(38) [root@localhost URI-1.65]# perl Makefile.PL Writing Makefile for URI [root@localhost URI-1.65]# make : Manifying blib/man3/URI::Heuristic.3pm [root@localhost URI-1.65]# make test : All tests successful. Files=39, Tests=611, 1 wallclock secs ( 0.09 usr 0.02 sys + 0.58 cusr 0.05 csys = 0.74 CPU) Result: PASS [root@localhost URI-1.65]# [root@localhost URI-1.65]# make install
Installing /usr/local/share/man/man3/URI::QueryParam.3pm Installing /usr/local/share/man/man3/URI::Escape.3pm Installing /usr/local/share/man/man3/URI::Split.3pm Installing /usr/local/share/man/man3/URI.3pm Appending installation info to /usr/lib/perl5/perllocal.pod [root@localhost URI-1.65]#
(39) success
http://insecta.idv.tw/awstats/awstats.pl?config=insecta.idv.tw [root@localhost URI-1.65]# date 日 12月 28 09:23:41 CST 2014 [root@localhost URI-1.65]# uname -a Linux localhost.localdomain 3.14.19-100.fc19.i686.PAE #1 SMP Wed Sep 17 22:23:56 UTC 2014 i686 i686 i386 GNU/Linux [root@localhost URI-1.65]#
[root@localhost URI-1.65]# chmod 777 /var/lib/awstats
|