免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 708 | 回复: 0
打印 上一主题 下一主题

awstats配置for linux [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-04 12:08 |只看该作者 |倒序浏览

awstats简易安装文档
step 1 安装
1、 安装apache2.2.0
tar jxvf httpd-2.2.0 tar.bz2
  cd httpd-2.2.0
  vi config.sh
#!/bin/bash
HTTPD_ROOT="/usr/local/apps/apache2"
./configure --prefix=$HTTPD_ROOT \
--enable-so \
--enable-rewrite \
--enable-info \
--enable-cgid \
--enable-mime-magic \
--enable-vhost-alias \
--enable-deflate \
--enable-expires \
--with-mpm=prefork
sh config.sh
make
make install
2 、安装awstats6.5
tar zxvf awstats-6.5.tar.gz
mv awstats-6.5 /usr/apps/local/awstats
step 2 配置
1、apache配置
vi /usr/local/apps/apache2/conf/httpd.conf
    DocumentRoot /usr/local/apps/awstats/wwwroot/
    ServerName irunnet.com
    ErrorLog "/usr/local/apps/apache2/logs/irunnet-error_log"
    CustomLog "/usr/local/apps/apache2/logs/irunnet-access_log" combined
[root@mail bin]# ./apachectl stop
[root@mail bin]# ./apachectl start
2、awstats配置
A、运行配置脚本生成awstats的配置文件
   cd /usr/local/apps/awstats/tools
   perl awstats_configure.pl
   >> 默认生成的配置文件会放在/etc/awstats/下面,名称为awstats.www.irunnet.com.conf
  >>默认安装后重启apache
[root@mail bin]# ./apachectl stop
[root@mail bin]# ./apachectl start
B、编辑/etc/awstats/awstats.www.irunnet.com.conf
   >>1 设置web server的logfile位置
       编辑LogFile为web server的log文件位置
       LogFile=/usr/local/apps/apache2/logs/irunnet-access_log
      [确认和httpd.conf中的log文件保证一致,httpd.conf中log: logs/irunnet-access_log]
   >>2 设置要分析的服务日志类型
       LogType=W  
       w表示为WEB日志
   >>3 设置日志格式
       LogFormat=1
       1表示采用NCSA apache combined/ELF/XLF log format
   >>4 设置所要分析网站域名
       SiteDomain=
www.irunnet.com
       HostAliases="irunnet.com  61.162.XXX.YYY localhost"
      >>5 设置awstats的数据库存放目录
       DirData="/usr/local/apps/awstats/data"[data需要手动建立]
   >>6 设置DirCgi
       DirCgi="/usr/local/apps/awstats/wwwroot/cgi-bin"
        DirIcons="/icon/"[这里icon是DocumentRoot /usr/local/awstats/wwwroot/下]
C、awstats权限修改
[root@irunnet awstats]# cd /usr/apps/local/apps
[root@irunnet apps]# chown -R root:root awstats
[root@irunnet apps]# chmod -R 755 awstats
[root@irunnet apps]# cd awstats
[root@irunnet awstats]# mkdir data
[root@irunnet awstats]#chown -R nobody data[nobdy为apache运行用户]
[root@irunnet awstats]#chmod -R 755 data
[root@irunnet awstats]#cd wwwroot/cgi-bin
[root@irunnet cgi-bin]# perl awstats.pl -config=www.irunnet.com -update -lang=cn
[root@irunnet cgi-bin]# perl awstats.pl -config=www.irunnet.com -output -staticlinks -lang=cn>awstats.www.irunnet.com.html
[root@irunnet cgi-bin]# chmod 777 /usr/local/apps/awstats/wwwroot/cgi-bin/*.pl
D、修改etc/awstats/awstats.www.irunnet.com.conf
AllowToUpdateStatsFromBrowser=1
step 3 测试
http://www.irunnet.com/awstats/awstats.pl?config=www.irunnet.com

step 4 日志统计自动运行
10 8 * * * (cd /usr/local/apps/www/awstats/cgi-bin/awstats/;./awstats.pl -config=www.irunnet.com -update -lang=cn)
参考资料


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/14155/showart_333935.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP