问题描述
是否可以在 OpenLiteSpeed 中安装 AWstats 日志分析器?
我无法从此 2015 年文档中找到 lsws/admin/misc/awstats_install.sh
脚本:
https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:config:awstats
所以我在我的 Ubuntu Droplet 上使用 sudo apt install awstats
手动安装了 AWstats,但我缺少有关如何在 OpenLiteSpeed WebAdmin 中引入图表的链接。
谢谢
解决方法
我只是做了一个粗略的设置,手动设置 AwStats 似乎可以在我的 OpenLiteSpeed Web 服务器上运行。
- 安装您已经安装的 AwStats
sudo apt install awstats
。 - 设置 AwStats 配置。请将以下条目添加到 /etc/awstats/awstats.conf:
- 包括“/etc/awstats/awstats.conf.local”
- LogFile="/var/www/html/logs/access.log"
- SiteDomain="example.com"
- HostAliases="example.com localhost 127.0.0.1"
- AllowToUpdateStatsFromBrowser=1
注意,请务必使用您自己的设置替换example.com域名和访问日志路径。
- 验证您的 AwStats 设置
构建从当前日志生成的初始统计数据,
/usr/lib/cgi-bin/awstats.pl -config=example.com -update
示例返回:
From data in log file "/var/www/html/logs/access.log"...
Phase 1 : First bypass old records,searching new record...
Direct access after last parsed record (after line 50)
Jumped lines in file: 50
Found 50 already parsed records.
Parsed lines in file: 146
Found 0 dropped records,Found 0 comments,Found 0 blank records,Found 0 corrupted records,Found 0 old records,Found 146 new qualified records.
如果输出没有错误,我们就可以开始设置Awstats显示
- 显示 Awstats
将 cgi-bin 和图标的符号链接添加到您的文档根目录
ln -sf /usr/lib/cgi-bin /var/www/html/cgi-bin
ln -sf /usr/share/awstats/icon/* /var/www/html/awstats-icon
导航到 Web Admin at port 7080 > VirtualHosts > Name > Context,然后创建 CGI 上下文
- URI=/cgi-bin/
- Path=/var/www/html/cgi-bin
点击保存按钮,然后正常重启网络服务器。
现在您可以通过访问 URL 来访问您的 AwStats,http://your-server-ip/cgi-bin/awstats.pl?config=example.com