LoginSignup
0
0

More than 1 year has passed since last update.

Apacheログの探し方

Last updated at Posted at 2022-03-10

httpd.confの場所を探す

こちらの記事が参考になった

httpd.confでログの場所を確認

httpd.confで

  • CustomLog をgrep→ログのパスとどのフォーマットを使ってるかチェック(ログのパスはServerRootからの相対パスになっているのでServerRootもgrepする)
ServerRoot "/etc/httpd"
CustomLog "logs/access_log" combined env=!nolog

→ 「ログの場所は /etc/httpd/logs/access_log で、フォーマットはcombined」ということがわかる

フォーマットを確認

  • httpd.confでLogFormat をgrep→実際のフォーマットをチェック
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

→ 「(このサーバーではcombinedが使われているので)ログのフォーマットは %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"」ということがわかる

フォーマットの見方はこちらが参考になった
https://qiita.com/ryounagaoka/items/e7782ab29ff9fbe8f891

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0