[AWS EC2] apache logの見方

ssh ec2-user@${public ip} -i ~/.ssh/***.pem
cat /etc/httpd/conf.d/custom.conf

# アクセスログ
<IfModule log_config_module>
    CustomLog "/var/www/log/access_log" combined
</IfModule>

$ cd /var/www/log/
$ ls
access_log error_log

$ sudo less /var/log/httpd/error_log
$ sudo less /var/log/httpd/access_log

### アクセスログの見方
$ cat /etc/httpd/conf/httpd.conf
LogFormat “%h %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\” %I %O” combinedio

%h リモートホストのIPアドレス
%l 接続元のユーザー名
%u リモートユーザ
%t アクセスされた日時
\”%r\” アクセスされたファイル
%>s ステータスコード
%b リソースに対する転送量
\”%{Referer}i\” アクセス元のURL
\”%{User-Agent}i\” なんのOSでどのブラウザからアクセスしてきたか

なるほど。