没有不值得去解决的问题,也没有不值得去学习的技术!

Install and Configure AWstats 7.4 on Windows 10 64-Bit to Analyze Apache 2.4 Logs

Enable it to support statistics for multiple websites

1. Install and configure AWstats7.4 on Windows 10 64-bit to support Apache 2.4 log analysis;

2. Install Perl. Open https://www.perl.org/ . As shown in Figure 1, there are two versions for Windows: Strawberry Perl and ActiveState Perl. Here, ActiveState Perl is selected;

There are two versions for Windows: Strawberry Perl and ActiveState Perl. Here, ActiveState Perl is selected
There are two versions for Windows: Strawberry Perl and ActiveState Perl. Here, ActiveState Perl is selected

3. Open http://www.activestate.com/activeperl/downloads . As shown in Figure 2, download the 64-bit version;

Download the 64-bit version
Download the 64-bit version

4. Install Perl. An error prompts: As shown in Figure 3, this installation package could not be opened. Please contact the application vendor to confirm that this is a valid Windows Installer package.

This installation package could not be opened. Please contact the application vendor to confirm that this is a valid Windows Installer package
This installation package could not be opened. Please contact the application vendor to confirm that this is a valid Windows Installer package

5. Download the 64-bit version of 5.22.0.2200. As shown in Figure 4, the name is: ActivePerl-5.22.0.2200-MSWin32-x64-299195.msi, and the error no longer appears.

Download the 64-bit version of 5.22.0.2200
Download the 64-bit version of 5.22.0.2200

6. During installation, an error occurs: The selected dirctory contains an incompatible version of ActivePerl,Please choose a different installation location!
The selected directory contains an incompatible version of ActivePerl. Please choose a different installation location! Uninstall it first, then reinstall;

5
6
7
The selected directory contains an incompatible version of ActivePerl. Please choose a different installation location!
The selected directory contains an incompatible version of ActivePerl. Please choose a different installation location!
9
10
11

7. Run in cmd.exe: perl -v. It runs normally;

Run in cmd.exe: perl -v. It runs normally;
Run in cmd.exe: perl -v. It runs normally;

8. Open http://www.awstats.org/ , download awstats-7.4, install AWstats, and copy awstats-7.4 to E:\wwwroot\awstats-7.4;

9. Run: E:\wwwroot\awstats-7.4\tools>perl awstats_configure.pl

Run: E:\wwwroot\awstats-7.4\tools>perl awstats_configure.pl
Run: E:\wwwroot\awstats-7.4\tools>perl awstats_configure.pl
14
15
Add virtual host kcuc.ygt.cm
Add virtual host kcuc.ygt.cm

10. Modify: C:/Apache24/conf/httpd.conf

AddHandler cgi-script .cgi
AddHandler cgi-script .pl

#
# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses “E:/wwwroot/awstats-7.4/wwwroot/classes/”
Alias /awstatscss “E:/wwwroot/awstats-7.4/wwwroot/css/”
Alias /awstatsicons “E:/wwwroot/awstats-7.4/wwwroot/icon/”
ScriptAlias /awstats/ “E:/wwwroot/awstats-7.4/wwwroot/cgi-bin/”

#
# This is to permit URL access to scripts/files in AWStats directory.
#

<Directory “E:/wwwroot/awstats-7.4/wwwroot”>

Options FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny

Allow from all

</Directory>

Modify: C:/Apache24/conf/httpd.conf
Modify: C:/Apache24/conf/httpd.conf
Modify: C:/Apache24/conf/httpd.conf, change to absolute path
Modify: C:/Apache24/conf/httpd.conf, change to absolute path

11. Modify: E:\wwwroot\awstats-7.4\wwwroot\cgi-bin\awstats.kcuc.ygt.cm.conf

LogFile=”C:/Apache24/logs/kcuc.ygt.cm-access_log”

SiteDomain=”kcuc.ygt.cm”

Lang=”cn”

AllowToUpdateStatsFromBrowser=1 //Set to allow running the update process from your browser

12. Modify: E:\wwwroot\awstats-7.4\wwwroot\cgi-bin\awstats.pl

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

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

13. Run: perl awstats.pl -config=kcuc.ygt.cm -update, as shown in Figure 17

Run: perl awstats.pl -config=kcuc.ygt.cm -update
Run: perl awstats.pl -config=kcuc.ygt.cm -update

14. Open: http://localhost/awstats/awstats.pl?config=kcuc.ygt.cm , as shown in the figure

Open: http://localhost/awstats/awstats.pl?config=kcuc.ygt.cm
Open: http://localhost/awstats/awstats.pl?config=kcuc.ygt.cm

15. To enable it to support statistics for multiple websites, copy E:\wwwroot\awstats-7.4\wwwroot\cgi-bin\awstats.kcuc.ygt.cm.conf to: E:\wwwroot\awstats-7.4\wwwroot\cgi-bin\awstats.www.ygt.cm.conf
LogFile=”C:/Apache24/logs/www.ygt.cm-access_log”

SiteDomain=”www.ygt.cm”

Enable it to support statistics for multiple websites
Enable it to support statistics for multiple websites

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系