awstats的安裝問題

发布于 2021-11-14 01:51:40 字数 571 浏览 812 评论 3

想請教一下小弟想於nginx上安上一個awstats

安裝完成了, 但awstats好像拿取不了log file.

而現在/var/lib/awstats內都是空的. 沒有任何file.

但我在/etc/awstats/xxxxx.conf檢查過logfile的路徑是正確的.

而nginx的log format是:
# Examples for Apache combined logs (following two examples are equivalent):
# LogFormat = 1
# LogFormat = "%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot"
#
# Example for IIS:
# LogFormat = 2
#
LogFormat=1
LogFormat= "%host %logname %time1 %methodurl %code %bytesd %refererquot %uaquot %other"

現在怎樣也搞不清為什麼會這樣.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

月亮是我掰弯的 2021-11-14 21:01:57

我現在的環境是迢這樣的:

Nginx的vhost log:
/home/wwwlogs/xxx.log
Nginx.conf的log format:
 log_format  xxx.com  '$remote_addr - $remote_user [$time_local] "$request" '
 '$status $body_bytes_sent "$http_referer" '
 '"$http_user_agent" $http_x_forwarded_for';
 access_log  /home/wwwlogs/xxx.com.log  xxx.com;

awstats的db在:
var/lib/awstats
要生成報告的command是:
/usr/local/awstats/tools/awstats_buildstaticpages.pl -update -config=xxx.com -lang=tw -dir=/home/wwwroot/xxx.com/awstats/ -awstatsprog=/usr/local/awstats/wwwroot/cgi-bin/awstats.pl

希望有師兄希忙解答一下

滥情空心 2021-11-14 15:03:55

log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '

             '$status $body_bytes_sent "$http_referer" '

             '"$http_user_agent" $http_x_forwarded_for';

飘然心甜 2021-11-14 06:10:12

试试下边这个 Log format

        log_format  www.xxxx.com_access

        '$remote_addr - $remote_user [$time_local] $request '

        '"$status" $body_bytes_sent "$http_referer" '

        '"$http_user_agent" "$http_x_forwarded_for"';

        access_log  /data/logs/web_log/www.xxxx.com_access.log;

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文