awstats安装

awstats安装
 
1)cd /usr/local/src
2)wget http://prdownloads.sourceforge.net/awstats-6.9.tar.gz
3)tar zxvf awstats-6.9.tar.gz
4)cp -r awstats-6.9 /usr/local/awstats
5)cd /usr/local/awstats/
6)perl /usr/local/awstats/tools/awstats_configure.pl
结果如下:
 
1. -----> Check for web server install
2. 
3. 
4. 
5. Enter full config file path of your Web server.
6. 
7. Example: /etc/httpd/httpd.conf
8. 
9. Example: /usr/local/apache2/conf/httpd.conf
10. 
11. Example: c:\Program files\apache group\apache\conf\httpd.conf
12. 
13. Config file path ('none' to skip web server setup):
14. 
15. > /etc/httpd/conf/httpd.conf
16. 
17. 
18. 
19. -----> Check and complete web server config file '/etc/httpd/conf/httpd.conf'
20. 
21.   Add 'Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"'
22. 
23.   Add 'Alias /awstatscss "/usr/local/awstats/wwwroot/css/"'
24. 
25.   Add 'Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"'
26. 
27.   Add 'ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"'
28. 
29.   Add '<Directory>' directive
30. 
31.   AWStats directives added to Apache config file.
32. 
33. 
34. 
35. -----> Update model config file '/usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf'
36. 
37.   File awstats.model.conf updated.
38. 
39. 
40. 
41. -----> Need to create a new config file ?
42. 
43. Do you want me to build a new AWStats config/profile
44. 
45. file (required if first install) [y/N] ? y
46. 
47. 
48. 
49. -----> Define config file name to create
50. 
51. What is the name of your web site or profile analysis ?
52. 
53. Example: www.mysite.com
54. 
55. Example: demo
56. 
57. Your web site, virtual server or profile name:
58. 
59. > www.baiyuan.com
60. 
61. 
62. 
63. -----> Define config file path
64. 
65. In which directory do you plan to store your config file(s) ?
66. 
67. Default: /etc/awstats
68. 
69. Directory path to store config file(s) (Enter for default):
70. 
71. > 
72. 
73. 
74. 
75. -----> Create config file '/etc/awstats/awstats.tracker.yihaodian.com.conf'
76. 
77.  Config file /etc/awstats/awstats.tracker.yihaodian.com.conf created.
78. 
79. 
80. 
81. -----> Restart Web server with '/sbin/service httpd restart'
82. 
83. Stopping httpd: [  OK  ]
84. 
85. Starting httpd: httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
86. 
87. [  OK  ]
88. 
89. 
90. 
91. -----> Add update process inside a scheduler
92. 
93. Sorry, configure.pl does not support automatic add to cron yet.
94. 
95. You can do it manually by adding the following command to your cron:
96. 
97. /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=tracker.yihaodian.com
98. 
99. Or if you have several config files and prefer having only one command:
100. 
101. /usr/local/awstats/tools/awstats_updateall.pl now
102. 
103. Press ENTER to continue... 
104. 
105. 
106. 
107. 
108. 
109. A SIMPLE config file has been created: /etc/awstats/awstats.www.baiyuan.com.conf
110. 
111. You should have a look inside to check and change manually main parameters.
112. 
113. You can then manually update your statistics for 'www.baiyuan.com' with command:
114. 
115. > perl awstats.pl -update -config=www.baiyuan.com
116. 
117. You can also read your statistics for 'www.baiyuan.com' with URL:
118. 
119. > http://www.baiyuan.com/awstats/awstats.pl?config=www.baiyuan.com
120. 
121. 
122. 
123. Press ENTER to finish...
124. 
7)只需修改/etc/awstats/awstats.www.baiyuan.com.conf的logfile
vim /etc/awstats/awstats.www.baiyuan.com.conf
#########################awstats.www.baiyuan.com.conf#############
LogFile="/var/log/apache/www/access_log.%YYYY-24%MM-24%DD-24"
######################################end#########################
 
8.)产生日志数据
你能通过如下命令手工产生统计数据,通常是刚刚安装之后
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.baiyuan.com
 
9.)接下来你需要通过crontab来定时跑上面的脚本
crontab -e
0 3 * * *  . /etc/awstats/awstats.sh
/etc/init.d/crond reload 重新加载
 
10.)通过url访问
http://baby.baiyuan.com/awstats/awstats.pl?config=baby.baiyuan.com

插件安装:

配置Geo-IP:
Geo-IP C-API
wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.6.tar.gz
tar -zxvf GeoIP-1.4.6.tar.gz
cd GeoIP-1.4.6
./configure
make
make install
Geo-IP Perl-API
wget http://geolite.maxmind.com/download/geoip/api/perl/Geo-IP-1.37.tar.gz
tar -zxvf Geo-IP-1.37.tar.gz
cd Geo-IP-1.37
perl Makefile.PL
make
make install
Geo::IPfree
wget http://mirrors.geoexpat.com/cpan/authors/id/G/GM/GMPASSOS/Geo-IPfree-0.2.tar.gz
tar -zxvf Geo-IPfree-0.2.tar.gz
cd Geo-IPfree-0.2
perl Makefile.PL
make
make install
安装国家数据库:
wget http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoLiteCity.dat.gz
cp GeoLiteCity.dat /usr/local/share/GeoIP/

配置:通过在配置文件中启用GEOIP相关插件:
LoadPlugin="geoip GEOIP_STANDARD /home/apache/chedong.com/cgi-bin/awstats/GeoIP.dat"
LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /home/apache/chedong.com/cgi-bin/awstats/GeoLiteCity.dat"
 
echo "LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /usr/local/share/GeoIP/GeoLiteCity.dat"" >> /etc/awstats/awstats.www.baiyuan.com.conf
echo "LoadPlugin="geoip GEOIP_STANDARD /usr/local/share/GeoIP/GeoIP.dat"" >> /etc/awstats/awstats.www.baiyuan.com.conf
awstats.X.X.X.conf
#LoadPlugin="decodeutfkeys" 解决搜索引擎乱码问题

你可能感兴趣的:(职场,awstats,休闲)