查看文章 |
参考多个人的文档 1.apache安装 apache安装 #wget http://archive.apache.org/dist/httpd/httpd-2.0.54.tar.gz 2.cronolog 安装,请参考我写的上一篇文章 3.AWStats安装 4.配置
QUOTE:
----- AWStats awstats_configure 1.0 (build 1.3) (c) Laurent Destailleur -----
chmod 755 /usr/local/awstatsThis 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 Enter full config file path of your Web server. Example: /etc/httpd/httpd.conf Example: /usr/local/apache2/conf/httpd.conf Example: c:Program filesapache groupapacheconfhttpd.conf Config file path ('none' to skip web server setup): >;/etc/httpd/conf/httpd.conf #输入apache 的配置文件目录 ----->; Check and complete web server config file '/usr/local/apache AWStats directives 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 #输入 y,确定产生 AWStats配置文件 ----->; 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 #输入 www,为配置文件最名字,此可自取 ----->; 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): >; #直接按下 Enter, ----->; Create config file '/etc/awstats/awstats.www.conf' Config file /etc/awstats/awstats.www.conf created. ----->; Restart Web server with '/sbin/service httpd restart' 停止 httpd: [ 确定 ] 启动 httpd: [ 确定 ] ---->; 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 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... #按下 Enter 继续,按两次 mkdir /var/lib/awstats #修改配置文件 cp /etc/awstats/awstats.www.conf /etc/awstats/awstats.www.conf.bak #备份配置文件 vi /etc/awstats/awstats.www.conf QUOTE:
51行 LogFile="/var/log/httpd/mylog.log" 修改成-->; /LogFile="/usr/local/apache/logs/960it_access_log.%YYYY-24%MM-24%DD.log"
#修改你的LOG文件及目录,配合cronolog 和cron分析当天的日志 147行 SiteDomain="www" 修改成-->; SiteDomain="你的域名" 182行 DNSLookup=2 修改成-->; DNSLookup=1 /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=www -update
/etc/rc.d/init.d/httpd stop /usr/local/apache/bin/apachectl restart QUOTE:
50 23 * * * root /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=www -update >;/dev/null 2>;
5.安全 保护/db/htdocs/www/awstat/禁止未授权用户访问
其中在 /usr/local/apache/passwd/下产生passwords 的密码文件
以上的设置由于要cgi支持,也增加了安全隐患可以用awstats 自带的awstats_buildstaticpages.pl来 生成静态页面 可以添加到crontab中 50 23 * * * * /usr/local/awstats/tools/awstats_buildstaticpages.pl -update -config=www. -lang=cn -dir=/db/htdocs/www/awstat/ -awstatsprog=/usr/local/awstats/wwwroot/cgi-bin/awstats.pl 如果www.abc.net 虚拟主机 主目录为/db/htdocs/www/ 则在浏览器中输入http://www.abc.net/awstat/awstats.www.abc.net.html 就可以通过认真访问静态页面 6.增加中awstats 显示来访者位置的插件 qqhostinfo 首先,点击这里下载插件。把它放在awstats/wwwroot/cgi-bin/plugins中。 其次,下载上一篇blog提到的分析QQWry.dat的perl脚本。 然后放在同一目录,去网上下载QQWry.Dat放在同一目录中,注意文件名一定要是QQWry.Dat,实际上是我用我的珊瑚版本的QQ的这个文件. 再编辑你得awstats配置文件,大概在LoadPlugin="hostinfo"的后面增加一行 require的路径改 require "/usr/local/awstats/wwwroot/cgi-bin/plugins/qqwry.pl"; |

