広告

AWS ubuntu

awstats セットアップ 設定

$sudo apt-get install awstats

#vi /etc/awstats/awstats.conf
# Apache のログフォーマットが"combined"の場合は「1」
# "common"の場合は「4」( ただしこの場合ブラウザ情報等、一部の解析はできなくなる)
LogFormat=1
# 153行目:ホスト名指定
SiteDomain="www.heart-net.biz"

#cp /usr/share/doc/awstats/examples/apache.conf /etc/apache2/conf-available/awstats.conf

#vi /etc/apache2/conf-available/awstats.conf
# Allow from 行のアクセス許可を自身の環境に合わせて全て変更

Allow from 10.0.0.0/24

root@www:~# a2enconf awstats serve-cgi-bin

Enabling conf awstats.
Enabling conf serve-cgi-bin.
To activate the new configuration, you need to run:
service apache2 reload
root@www:~# systemctl restart apache2

/etc/apache2/apache2.conf

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
Order allow,deny
Allow from xxx.xxx.xxx.xxx
AllowOverride All
Require all granted
Options +ExecCGI
AddHandler cgi-script .pl
</Directory>

/cgi-bin/awstats.plにアクセスすると
.pl ファイルをダウンロードしようとする
mod_cgiがはいっていない
# a2enmod cgi

/etc/logrotate.d# vi apache2

prerotate
/usr/share/awstats/tools/update.sh
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi; \
endscript

Hits: 1306

広告

  • この記事を書いた人

higa

システムエンジニアをやっています。 Linux,macOS好き。おもにシステム管理たまに豆柴こてつの話。 最近はスマートホームを推進中。

-AWS, ubuntu