1、配置好wamp apache 支持Perl

可以参见前面的文章《WAMP Apache 配置 Perl》

2、下载awstats-7.8

https://awstats.sourceforge.io/#DOWNLOAD
下载7.8的最新版本
解压缩后把整个目录复制至C:\wamp64\www下

3、运行awstats_configure.pl

cd C:\wamp64\www\awstats-7.8\tools
perl awstats_configure.pl

输入C:\wamp64\bin\apache\apache2.4.51

输入C:\wamp64\bin\apache\apache2.4.51\conf\httpd.conf

输入y

输入mylocalweb

下面是该命令输出的文本截取,供参考:

C:\Users\Wuser>cd C:\wamp64\www\awstats-7.8\toolsC:\wamp64\www\awstats-7.8\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: Windows-----> Check for web server install
awstats_configure did not find your Apache web main runtime.Please, enter full directory path of your Apache web server or
'none' to skip this step if you don't have local web server or
don't have permission to change its setup.
Example: c:\Program files\apache group\apache
Apache Web server path ('none' to skip):
> C:\wamp64\bin\apache\apache2.4.51Now, enter full config file path of your Web server.
Example: /etc/httpd/httpd.conf
Example: /usr/local/apache2/conf/httpd.conf
Example: c:\Program files\apache group\apache\conf\httpd.conf
Config file path ('none' to skip web server setup):
> C:\wamp64\bin\apache\apache2.4.51\conf\httpd.conf-----> Check and complete web server config file 'C:\wamp64\bin\apache\apache2.4.51\conf\httpd.conf'Add 'Alias /awstatsclasses "../wwwroot/classes/"'Add 'Alias /awstatscss "../wwwroot/css/"'Add 'Alias /awstatsicons "../wwwroot/icon/"'Add 'ScriptAlias /awstats/ "../wwwroot/cgi-bin/"'Add '<Directory>' directiveAWStats directives added to Apache config file.-----> Update model config file '..\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:
> mylocalweb-----> Create config file '..\wwwroot\cgi-bin\awstats.mylocalweb.conf'Config file ..\wwwroot\cgi-bin\awstats.mylocalweb.conf created.-----> Add update process inside a scheduler
Sorry, for Windows users, if you want to have statistics to be
updated on a regular basis, you have to add the update process
in a scheduler task manually (See AWStats docs/index.html).
Press ENTER to continue...A SIMPLE config file has been created: ..\wwwroot\cgi-bin\awstats.mylocalweb.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'mylocalweb' with command:
> perl awstats.pl -update -config=mylocalweb
You can also read your statistics for 'mylocalweb' with URL:
> http://localhost/awstats/awstats.pl?config=mylocalwebPress ENTER to finish...C:\wamp64\www\awstats-7.8\tools>

实际这上面还表述了一下,在Windows中定时任务需要自己配置。

4、配置wamp中Apache的配置

4.1 更改httpd.conf中最后添加的内容,因为自动插入的内容是为Apache 2.2 以前的版本配置的,现在Apache是2.4,所以需要更改。
4.2 同时要更改项目的目录位置。
4.3 更改日志输出格式。

4.1和4.2调整如下:

Alias /awstatsclasses "C:/wamp64/www/awstats-7.8/wwwroot/classes/"
Alias /awstatscss "C:/wamp64/www/awstats-7.8/wwwroot/css/"
Alias /awstatsicons "C:/wamp64/www/awstats-7.8/wwwroot/icon/"ScriptAlias /awstats/ "C:/wamp64/www/awstats-7.8/wwwroot/cgi-bin/"<Directory "C:/wamp64/www/awstats-7.8/wwwroot">AllowOverride allOptions allRequire localOptions +Indexes +FollowSymLinks +Multiviews
</Directory>

4.3 调整如下

更改日志格式,在httpd.conf中搜索CustomLog “${INSTALL_DIR}/logs/access.log” common,做如下更改

    # CustomLog "${INSTALL_DIR}/logs/access.log" common
CustomLog "${INSTALL_DIR}/logs/access.log" combined

如果不更改,后面运行时将报错

C:\wamp64\www\awstats-7.8\wwwroot\cgi-bin>perl awstats.pl -config=mylocalweb -update
Create/Update database for config "./awstats.mylocalweb.conf" by AWStats version 7.8 (build 20200416)
From data in log file "C:/wamp64/logs/access.log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
AWStats did not find any valid log lines that match your LogFormat parameter, in the 50th first non commented lines read of your log.
Your log file C:/wamp64/logs/access.log must have a bad format or LogFormat parameter setup does not match this format.
Your AWStats LogFormat parameter is:
1
This means each line in your web server log file need to have "combined log format" like this:
111.22.33.44 - - [10/Jan……………………………

5、修改脚本生成的配置文件

就是前面第3步生成的配置文件,要指向自己的Apache日志位置
修改C:\wamp64\www\awstats-7.8\wwwroot\cgi-bin\awstats.mylocalweb.conf

LogFile="C:/wamp64/logs/access.log"
Lang="cn"
AllowToUpdateStatsFromBrowser=1

6、修改脚本执行的命令解释器位置

修改C:\wamp64\www\awstats-7.8\wwwroot\cgi-bin\awstats.pl
把第一行#!/usr/bin/perl
改为

#!C:/Strawberry/perl/bin/perl.exe

7、重启wamp中的Apache服务

访问并点击几下Apache页面中的内容,以便acces.log中有数据

8、更新Apache日志数据

运行:

cd C:\wamp64\www\awstats-7.8\wwwroot\cgi-binperl awstats.pl -config=mylocalweb -updateC:\wamp64\www\awstats-7.8\wwwroot\cgi-bin>perl awstats.pl -config=mylocalweb -update
Create/Update database for config "./awstats.mylocalweb.conf" by AWStats version 7.8 (build 20200416)
From data in log file "C:/wamp64/logs/access.log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 90Found 0 dropped records,Found 0 comments,Found 0 blank records,Found 0 corrupted records,Found 0 old records,Found 90 new qualified records.C:\wamp64\www\awstats-7.8\wwwroot\cgi-bin>

9、访问awstats页面

用浏览器访问http://localhost/awstats/awstats.pl?config=mylocalweb

WAMP 下 awstats 配置相关推荐

  1. php drive mssql,wamp下对MS SQLSERVER的连接配置,PHP+THINKPHP5通过

    下载一个SQL Server Driver for PHP 这是一个扩展包,我是在这里下载的http://www.microsoft.com/en-us/download/details.aspx?i ...

  2. MyEclipse下JDBC-MySQL配置总结

    原创文章,转载请注明:MyEclipse下JDBC-MySQL配置总结  By Lucio.Yang 新手,初期配置未成功,后将网上的方法几乎全部尝试才弄好,下面的方法全而不简练,希望高手指正. 1. ...

  3. wamp安装和配置_手动配置Wordpress环境真香,让我毫不犹豫卸载LAMP和WAMP环境

    作为一名Java开发者,我平时也喜欢学习除Java以外的其他技术,例如PHP(有人说PHP是最好的编程语言,我无心考究).对于任何一个开发者,在学习一门新的编程语言过程中,首先都会面对配置开发环境这样 ...

  4. wamp下localhost目录Your Projects下项目无法打开解决方案

    最近在学php,然后可能遇到各种小白问题,记录下来当做自己成长的见证吧: wamp下localhost目录Your Projects下项目无法打开,但是在url中输入项目可以访问到. 解决方案: 找到 ...

  5. php7.0安装windows_Windows 7 下如何配置PHP网站运行环境

    Win7之家( www.win7china.com):Windows 7 下如何配置PHP网站运行环境 本文出处不详,有知者请通过文章下方的评论告知Win7之家,软媒会立即修改出处.本文适合PHP网站 ...

  6. resin-pro-4.0.34 服務器在windows环境下的配置

    resin-pro-4.0.34 服務器在windows环境下的配置 (轉載请注明作者:icelong) 到caucho網站上http://www.caucho.com/download/ 下載 re ...

  7. CentOS 6.5 下Vim 配置图解

    分享个CentOS 6.5 下Vim 配置图文详解,希望对大家有所帮助. 1. 登录并进入你常用的用户名下,查看其主目录 命令: # su xxx $ cd xxx $ ls -a 2.查看并建立目录 ...

  8. windows下apache配置虚拟主机的两个方法

    windows下apache配置虚拟主机方法一: 对httpd.conf进行设置: 1.注释以下三行 #ServerAdmin #ServerName #DocumentRoot 2.去掉mod_pr ...

  9. Linux环境下路由表配置一

    路由表配置网关及端口   网络地址:分析目标地址 接口:数据有可能从路由器的哪个出口出来,哪个就是接口 网关:目标网络与发数据的设备不在一个网段内,下一个路由器邻近主配置路由器的接口ip就是网关,线路 ...

最新文章

  1. AI 被当做炒作工具?
  2. 美团实习面试:熟悉红黑树?能不能手写一下?
  3. HashMap源码实现分析
  4. SpringBoot 究竟是如何跑起来的?
  5. 《 百度大脑AI技术成果白皮书》,介绍百度大脑5.0,附48页PDF下载
  6. 【新功能】MaxCompoute禁止Full Scan功能开放
  7. 让你的插件兼容AMD, CMD ,CommonJS和 原生 JS
  8. sed 插入多行_Linux三剑客之sed
  9. 设计模式笔记(7)---适配器模式(结构型)
  10. 2016年4月 TIOBE 编程语言排行榜
  11. 几种开源软件授权协议
  12. winpcap基本原理及常见应用_碳十四测年的基本原理和常见应用谬误
  13. Web Hacking 101 中文版 八、跨站请求伪造
  14. 获得CPU利用率(python调用top命令实现)
  15. explain mysql执行顺序_面试前必须知道的MySQL命令【explain】
  16. 社交规则:饭后抢着买单到底是客气还是客套?大多并不是真心的
  17. Java基础面试题(史上最全基础面试题,精心整理100家互联网企业面经)
  18. vue3父传子,子传父
  19. 热评云厂商:中科曙光4.68亿元,坚守城市云扩展政务云
  20. 用手机版python爬虫_Python爬虫也能用手机进行抓包?没错!这个技巧我只告诉你...

热门文章

  1. GC日志解读,这次别再说看不懂GC日志了
  2. Vue CLI 浏览器兼容性
  3. OSC赤岛在线数字化展厅数字化赋能
  4. 人群计数北航最新综述论文阅读:CNN-based Density Estimation and Crowd Counting: A Survey
  5. python中for和else的用法_Python循环结构中else用法(入门必读)
  6. 单片机直流电机转速控制(数码管显示、独立按键控制正反转、停止、开始、PID算法)
  7. 【工作流引擎】BPMN2.0介绍
  8. intellij idea 的历史版本
  9. 学生HTML个人网页作业作品 ~ 科技大学官网 网页设计成品~ 学生网页设计作业源码
  10. 2022年高处吊篮安装拆卸工(建筑特殊工种)考试题及答案