• Home
  • About
    • taichi photo

      taichi

      ars longa vita brevis.

    • Learn More
    • Twitter
    • LinkedIn
  • Posts
    • All Posts
    • All Tags
  • Projects

Proxyサーバーを使用したログの確認

03 Feb 2019

Reading time ~1 minute

Proxyサーバーを使用したログの確認

手順

手順

  1. apache2のインストールから
sudo apt-get install apache2
  1. とりあえずlogの内容を確認したいので、localhostにアクセス
wget http://localhost/

結果

vagrant@ubuntu-bionic:~$ wget http://localhost
--2019-04-08 05:12:50--  http://localhost/
Connecting to 10.0.2.15:8080... connected.
Proxy request sent, awaiting response... 200 OK
Length: 10918 (11K) [text/html]
Saving to: ‘index.html.1’

index.html.1                          100%[======================================================================>]  10.66K  --.-KB/s    in 0.001s  

2019-04-08 05:12:50 (12.0 MB/s) - ‘index.html.1’ saved [10918/10918]

そうしたらログが残っているはず。

  1. ということでログをチェック
sudo vim access.log

こんな感じで結果がかえってくればOK


127.0.0.1 - - [08/Apr/2019:05:12:50 +0000] "GET / HTTP/1.1" 304 182 "-" "Wget/1.19.4 (linux-gnu)"

まめちしき
apacheのログ方式はcombined

SquidログFMTを変更

squidのデフォルトフォーマットは見にくいためapacheと同じ方式に変更

手順

  1. squidのconfファイルを開いて編集
/etc/squid/
sudo vim squid.conf
#Default:
access_log daemon:/var/log/squid/access.log combined
→ここに「combined」を書き込む


ubuntuシステム Share Tweet +1