awstats安装 iis_在Windows Server和IIS上设置AWStats

awstats安装 iis

awstats安装 iis

When it comes to gathering statistics on web sites, you can never have enough. While one of the most popular method for tracking statistics is through services such as Google Analytics, log file analysis remains a reliable way to track your visitors as they are immune to script blockers. A widely used tool for log file analysis is the open source tool, AWStats.

当涉及在网站上收集统计信息时,您将永远无法拥有足够的资源。 尽管最流行的跟踪统计信息的方法之一是通过Google Analytics(分析)之类的服务,但日志文件分析仍然是跟踪访问者的可靠方法,因为它们不受脚本阻止程序的影响。 开源工具AWStats是广泛使用的日志文件分析工具。

Before setting up AWStats, you will need to make sure Perl installed on your Windows Server 2003/IIS 6 or Windows Server 2008/IIS 7 machine.

在设置AWStats之前,您需要确保Windows Server 2003 / IIS 6Windows Server 2008 / IIS 7计算机上安装了Perl。

配置网站日志 (Configuring Web Site Logging)

In order to capture the data AWStats tracks, your sites must log the following fields:

为了捕获AWStats跟踪的数据,您的站点必须记录以下字段:

  • date

    日期
  • time

    时间
  • c-ip

    IP
  • cs-username

    cs用户名
  • cs-method

    CS方法
  • cs-uri-stem

    cs-uri-stem
  • sc-status

    状态
  • sc-bytes

    sc字节
  • cs-version

    CS版本
  • cs(User-Agent)

    cs(用户代理)
  • cs(Referer)

    cs(推荐人)

IIS 6安装 (IIS 6 Setup)

To configure logging in IIS 6, open IIS Manager and right click on the Web Sites folder and select Properties.

要在IIS 6中配置日志记录,请打开IIS管理器,然后右键单击“网站”文件夹,然后选择“属性”。

image

On the Web Site tab, click the Properties button in the Enable logging section.

在“网站”选项卡上,单击“启用日志记录”部分中的“属性”按钮。

image

In the Logging Properties, configure the schedule to be daily with local time used for file naming and rollover.

在“日志记录属性”中,将日程表配置为每天,并使用本地时间进行文件命名和过渡。

image

On the Advanced tab, configure the required fields to be logged.

在“高级”选项卡上,配置要记录的必填字段。

image
image

Apply your changes.

应用您的更改。

IIS 7安装 (IIS 7 Setup)

To configure logging in IIS 7, open IIS Manager and select Logging from the server configuration options.

要在IIS 7中配置日志记录,请打开IIS管理器,然后从服务器配置选项中选择“日志记录”。

image

In the Logging configuration, set up a single log file per site which rolls over daily using the local time for file naming.

在“日志记录”配置中,每个站点设置一个日志文件,该日志文件每天使用本地时间进行文件名轮换。

image

Click the Select Fields button and check the boxes next to the required fields.

单击选择字段按钮,然后选中必填字段旁边的框。

image

Apply your changes.

应用您的更改。

设置AWStats (Setting Up AWStats)

Download the AWStats zip package from Sourceforge. Create a folder called ‘awstats’ in your ‘C:inetpubwwwroot’ folder and extract the following files from the downloaded zip file to this folder:

从Sourceforge下载AWStats zip软件包。 在“ C:inetpubwwwroot”文件夹中创建一个名为“ awstats”的文件夹,并将以下文件从下载的zip文件中提取到该文件夹​​中:

  • /wwwroot/icon

    / wwwroot / icon
  • /wwwroot/cgi-bin/lang

    / wwwroot / cgi-bin / lang
  • /wwwroot/cgi-bin/lib

    / wwwroot / cgi-bin / lib
  • /wwwroot/cgi-bin/plugins

    / wwwroot / cgi-bin / plugins
  • /wwwroot/cgi-bin/awredir.pl

    /wwwroot/cgi-bin/awredir.pl
  • /wwwroot/cgi-bin/awstats.model.conf

    /wwwroot/cgi-bin/awstats.model.conf
  • /wwwroot/cgi-bin/awstats.pl

    /wwwroot/cgi-bin/awstats.pl
image

Once the files are extracted, copy the “awstats.model.conf” file to a file named “awstats.domain.com.conf” (where domain.com is the site to track), open it in Notepad and configure the options as needed.

提取文件后,将“ awstats.model.conf”文件复制到名为“ awstats.domain.com.conf”的文件(其中domain.com是要跟踪的站点),在记事本中打开它,并将选项配置为需要。

The first thing you will need to configure is the log file location, which by default is located here:

您需要配置的第一件事是日志文件位置,默认情况下位于此处:

  • Server 2003: C:WINDOWSsystem32LogFilesW3SVC[IIS_ID]

    Server 2003:C:WINDOWSsystem32LogFilesW3SVC [IIS_ID]
  • Server 2008: C:inetpublogsLogFilesW3SVC[IIS_ID]

    Server 2008:C:inetpublogsLogFilesW3SVC [IIS_ID]

You can find the IIS ID by looking at the master site listing in IIS Manager and noting the value in the ID column next to the respective site.

您可以通过在IIS管理器中查看主站点列表并在相应站点旁边的ID列中记下值来找到IIS ID。

image

Set the options in the configuration file. This file has a very good explanation of what each option does, so take a few minutes to review them. Here are a few settings of interest according to the setup above:

在配置文件中设置选项。 该文件对每个选项的作用都有很好的解释,因此请花几分钟来对其进行复查。 根据上述设置,以下是一些您感兴趣的设置:

  • LogFile=”C:inetpublogsLogFilesW3SVC1u_ex%YY-24%MM-24%DD-24.log” (Server 2008/IIS 7 where the stats are calculated daily)

    LogFile =“ C:inetpublogsLogFilesW3SVC1u_ex%YY-24%MM-24%DD-24.log” (服务器2008 / IIS 7,每天计算统计信息)

  • LogFile=”C:WINDOWSsystem32LogFilesW3SVC1ex%YY-4%MM-4%DD-4.log” (Server 2003/IIS 6 where the stats are calculated every 4 hours to be updated throughout the day)

    LogFile =“ C:WINDOWSsystem32LogFilesW3SVC1ex%YY-4%MM-4%DD-4.log” (Server 2003 / IIS 6,每4个小时计算一次统计信息,全天更新一次)

  • LogFormat=”date time cs-method cs-uri-stem cs-username c-ip cs-version cs(User-Agent) cs(Referer) sc-status sc-bytes”

    LogFormat =“日期时间cs方法cs-uri-stem cs用户名c-ip cs版本cs(User-Agent)cs(Referer)sc状态sc-bytes”
  • SiteDomain=”domain.com”

    SiteDomain =“ domain.com”
  • HostAliases=”www.domain.com 11.22.33.44″ (any other URL’s which point to your site)

    HostAliases =” www.domain.com 11.22.33.44” (指向您网站的任何其他URL)

  • DirIcons=”icon”

    DirIcons =“图标”
  • DefaultFile=”index.php index.html”

    DefaultFile =“” index.php index.html”

Once you have saved your configuration file, run the AWStats Perl Script to compile the stats data. The command looks like this:

保存配置文件后,请运行AWStats Perl脚本来编译统计数据。 该命令如下所示:

C:inetpubwwwrootawstats>C:Perlbinperl.exe awstats.pl -config=domain.com

C:inetpubwwwrootawstats> C:Perlbinperl.exe awstats.pl -config = domain.com

image

The above command assumes the following (configuration used for this article):

上面的命令假定以下内容(本文使用的配置):

  • The folder “C:inetpubwwwrootawstats” serves the stats through IIS.

    文件夹“ C:inetpubwwwrootawstats”通过IIS提供统计信息。
  • Perl was installed to the “C:Perl” directory.

    Perl已安装到“ C:Perl”目录。
  • The config file is named “awstats.domain.com.conf”.

    该配置文件名为“ awstats.domain.com.conf”。

Finally, you can access the stats data through your browser. This URL is publically available for anyone to view unless you configure security via IIS. To test our configuration, just browse to:

最后,您可以通过浏览器访问统计数据。 除非您通过IIS配置安全性,否则此URL可公开供任何人查看。 要测试我们的配置,只需浏览至:

http://localhost/awstats/awstats.pl?config=domain.com

http://localhost/awstats/awstats.pl?config = domain.com

image

调度统计更新 (Scheduling Stats Update)

One of the configurations we set in the config file is the ‘LogFile’ location which defines the amount of hours to subtract from the date portions of the file. So to automate the process of compiling your stats, set up a Windows Scheduled Task which runs the command you used above to build the stats on the interval you configured.

我们在配置文件中设置的配置之一是“ LogFile”位置,该位置定义了从文件的日期部分减去的小时数。 因此,要自动执行统计信息的编译过程,请设置Windows计划任务,该任务将运行您上面使用的命令,以您配置的时间间隔构建统计信息。

链接 (Links)

Download AWStats (zip package)

下载AWStats (压缩包)

翻译自: https://www.howtogeek.com/50526/setting-up-awstats-on-windows-server-and-iis/

awstats安装 iis

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值