Bagaimana menghentikan grooving access.log Apache setiap beberapa detik?


9

Saya menginstal Ubuntu 12,04 Server + Zend Server CE (MySQL / PHPmyadmin) baru dari deb http://repos.zend.com/zend-server/5.6.0_ubuntu1204/deb server non-free Repository.

Apache2 / access.log saya terlihat seperti ini dan diputar setiap beberapa detik:

::1 - - [06/Aug/2012:13:27:59 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
::1 - - [06/Aug/2012:13:27:59 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
::1 - - [06/Aug/2012:13:27:59 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
::1 - - [06/Aug/2012:13:28:00 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
::1 - - [06/Aug/2012:13:28:00 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
::1 - - [06/Aug/2012:13:28:00 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
::1 - - [06/Aug/2012:13:28:00 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
::1 - - [06/Aug/2012:13:28:00 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
223.255.255.1 - - [06/Aug/2012:13:28:08 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-"
223.255.255.1 - - [06/Aug/2012:13:28:13 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-"
223.255.255.1 - - [06/Aug/2012:13:28:18 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-"
223.255.255.1 - - [06/Aug/2012:13:28:23 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-"
223.255.255.1 - - [06/Aug/2012:13:28:28 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-"
223.255.255.1 - - [06/Aug/2012:13:28:33 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-"
223.255.255.1 - - [06/Aug/2012:13:28:38 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-"
223.255.255.1 - - [06/Aug/2012:13:28:43 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-"
223.255.255.1 - - [06/Aug/2012:13:28:48 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-"
223.255.255.1 - - [06/Aug/2012:13:28:53 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-"
223.255.255.1 - - [06/Aug/2012:13:28:58 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-"

Apakah Anda tahu mengapa dan bagaimana cara mencegahnya?

Jawaban:


8

Anda perlu melakukan beberapa perubahan /etc/apache2/apache2.conf, khususnya:

  1. Buat beberapa tes lingkungan dengan SetEnvIf, dan;

  2. Kemudian, gunakan di baris CustomLog.

Sebagai berikut:

SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog
SetEnvIf Remote_Addr "::1" dontlog
SetEnvIf User-Agent ".*internal dummy connection.*" dontlog

CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined env=!dontlog

Baris terakhir itu seharusnya sudah ada dalam file, hanya tanpa bit terakhir.

Perhatikan bahwa ini akan mengatur dontlogvariabel lingkungan jika salah satu dari 3 SetEnvIfkondisi itu benar. Untuk menghindari ini, yah, itu rumit; tapi sepertinya blog ini punya solusinya.


alih-alih mengedit /etc/apache2/apache2.confsaya sudah mengedit /etc/apache2/conf.d/other-vhosts-access-logkarena saya tidak menemukan "CustomLog" di file konfigurasi pertama. Terima kasih dan harap ini membantu
Salvatorelab

Catatan satu mungkin harus menambahkan LoadModule setenvif_moduledan AddModule mod_setenvif.cke file httpd.conf - ref httpd.apache.org/docs/2.2/mod/mod_setenvif.html
MarkHu



0

Ini bekerja untuk saya

SetEnvIf Remote_Addr "127\.0\.0\.1" loopback
CustomLog logs/access_log combined env=!loopback

Saya harap ini berhasil juga untuk Anda.

Dengan menggunakan situs kami, Anda mengakui telah membaca dan memahami Kebijakan Cookie dan Kebijakan Privasi kami.
Licensed under cc by-sa 3.0 with attribution required.