nginxのconfファイルの設定
server {
listen 8080;
server_name example.com;
root /usr/share/awstats/wwwroot/;
location ~ \.pl$ {
gzip off;
fastcgi_pass phpfpm;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/share/awstats/wwwroot/cgi-bin/awstats-fcgi.php;
fastcgi_param X_SCRIPT_FILENAME /usr/share/awstats/wwwroot$fastcgi_script_name;
fastcgi_param X_SCRIPT_NAME $fastcgi_script_name;
}
location /awstats/classes/ {
alias /usr/share/awstats/wwwroot/classes/;
}
location /awstats/css/ {
alias /usr/share/awstats/wwwroot/css/;
}
location /awstats/icon/ {
alias /usr/share/awstats/wwwroot/icon/;
}
location /awstats/js/ {
alias /usr/share/awstats/wwwroot/js/;
}
}
実行するコマンド
chmod 755 /usr/share/awstats/wwwroot/ chmod 755 /var/lib/awstats/
chmod 655でもいけると思います。
perl /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -update -config=プロファイル名
※必ずオプションに-updateをつけること!
付けないとプロファイルで設定した保存ディレクトリに集計結果が保存されず、結果が表示されません。
プロファイル名は/etc/awstats/にあるファイルのawstats.と.confを除いたものになります。
詳しくは以下のサイトで紹介されています。
http://jyozi-hackdiary.sakura.ne.jp/wphackdiary/2017/04/22/post-33/


