设为首页 收藏本站
查看: 1269|回复: 0

[经验分享] Linux下“网站流量访问统计”软件“awstats”的配置安装使用过程

[复制链接]

尚未签到

发表于 2015-11-27 14:16:48 | 显示全部楼层 |阅读模式
1.从官网下载最新的的awstats,解压缩

# unzip awstats-6.95.zip

# mv awstats-6.95 /usr/local/awstats



2. 安装配置awstats,以我服务器上的网站phpadmin.dean.com为例,根据情况请自行更改网址

[iyunv@server56 LAMP]# cd /usr/local/awstats/
[iyunv@server56 awstats]# mkdir -m 755 data
[iyunv@server56 awstats]# perl tools/awstats_configure.pl -----> Check for web server install

  Found Web server Apache config file '/etc/httpd/httpd.conf'           <=============读取你的httpd配置文件



-----> Check and complete web server config file '/etc/httpd/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                                         <===============第一次需要创建一个新的config fiel



-----> 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:

> phpadmian.dean.com                          <====================这里输入你要记录的网址,当然是自己httpd服务器上的



-----> 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/awstats即可,直接回车



-----> Create config file '/etc/awstats/awstats.phpadmin.dean.com.conf'

Config file /etc/awstats/awstats.phpadmin.dean.com.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=phpadmin.dean.com

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.phpadmin.dean.com.conf

You should have a look inside to check and change manually main parameters.

You can then manually update your statistics for 'phpadmin.dean.com' with command:

> perl awstats.pl -update -config=phpadmin.dean.com

You can also read your statistics for 'phpadmin.dean.com' with URL:

> http://localhost/awstats/awstats.pl?config=phpadmin.dean.com            



Press ENTER to finish...                               <=============创建成功,按回车退出



3.修改配置文件/etc/awstats/awstats.drupal.dean.com.conf ,找到logFile那一行,将其修给为自己网站的访问日志路径,并且增加一样DataDir指向上面创建的data目录  vim /etc/awstats/awstats.drupal.dean.com.conf
  LogFile=&quot;/usr/local/apache/logs/druap.dean.com-access_log&quot;

DataDir=&quot;DataDir=&quot;/usr/local/awstats/data&quot;



4.生成统计日志网页。

1)首先需要创建/var/lib/awstats目录,否则在生成日志网页的时候报错

mkdir /var/lib/awstats2)确保你的网站访问日志&#26684;式为combined ,否则会报错

This means each line in your web server log file need to have &quot;combined log format&quot; like this:

3)确保awstats.pl有执行权限,否则无法生成日志网页

chmod +x /usr/local/awstats/wwwroot/cgi-bin/awstats.pl4)生成日志网页

cd /usr/local/awstats/wwwroot/cgi-bin
perl awstats.pl updata -config=phpadmin.dean.com5. 查看日志网页

在浏览器里输入:http://phpadmin.dean.com/awstats/awstats.pl?config=phpadmin.dean.com

效果如下

DSC0000.gif   6.可以将以上命令放到crontab中执行,并根据需要指定更新的频率和时间:

33 6 * * * /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=phpadmin.dean.com >/dev/null 2>&1

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-144164-1-1.html 上篇帖子: 强大的日志分析工具AWStats 下篇帖子: 利用awstats分析tomcat日志
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表