MONITORING WEB SERVER
Untuk memudahkan tugas admin ini aku ada cara untuk memonitor Web Server Apache, lewat
file log. Yang ada di direktori "/var/log/httpd" atau "/etc/httpd/logs". PERINGATAN :
mengaktifkan beberapa file log berarti akan MEMBOROSKAN RUANG DISK, karena peningkatan
jumlah file log.
1. konfigurasi httpd.conf
ErrorLog logs/error_log # direktori logs /etc/httpd/logs
LogLevel <fasilitas> # lihat manual man syslog.conf fasilitas = warn,
auth, err, debug dsb
LogLevel info
LogLevel warn < default >
2. File Log
2.1 access_log # akses klien terhadap file html di catat di sini
2.2 error_log # logging error di mulai saat httpd di start
# termasuk error dari klien saat mengakses file
2.3 referer_log # trace file yang diakses klien baris per baris
2.4 agent_log # mencatat jenis Web Browser yang digunakan klien
# misal Netscape, Internet Explorer dan mozzila
3. Membuat file log.
# cat /dev/null >> /var/log/httpd/referer_log
atau
# cat /dev/null >> /etc/httpd/logs/referer_log
4. konfigurasi commonhttpd.conf
HostnameLookups off # jika "off" yang dicatat nomor IP & jika "on"
nama domain
CustomLog logs/referer_log referer # trace klien thd akses file
CustomLog logs/agent_log agent # log web browser
CustomLog logs/access_log combined # log web browser, trace file
dan akses user
# sebaiknya jangan karena
akan meningkatkan
# jumlah ( size ) file
secara signifikan
5. Restart httpd
# /etc/rc.d/init.d/httpd restart
6. access_log
127.0.0.1 - - [19/Sep/2002:16:29:07 +0700] "GET /manual/mod/directive-dict.html
HTTP/1.0" 200 8894 "http://127.0.0.1/manual/mod/core.html#errorlog"
"Mozilla/4.78 [en] (X11; U; Linux 2.4.8-26mdk i586)"
127.0.0.1 - - [19/Sep/2002:16:29:40 +0700] "GET /manual/sections.html
HTTP/1.0" 200 5523
"http://127.0.0.1/manual/mod/directive-dict.html#Default"
"Mozilla/4.78 [en] (X11; U; Linux 2.4.8-26mdk i586)"
127.0.0.1 - - [19/Sep/2002:16:30:35 +0700] "GET /~budi
HTTP/1.0" 404 300 "-" "Lynx/2.8.5dev.2 libwww-FM/2.14 SSL-MM/1.4.1
OpenSSL/0.9.6a"
7. error_log
[Thu Sep 19 16:37:34 2002] [notice] Apache-AdvancedExtranetServer/1.3.20
(Mandrake Linux/3mdk) configured -- resuming
normal operations
[Thu Sep 19 16:37:34 2002] [info] Server built: Aug 24 2001 17:59:56
[Thu Sep 19 16:37:54 2002] [error] [client 127.0.0.1] File does not exist:
/home/budi/public_html
8. referer_log
- -> /
http://127.0.0.1/manual/mod/core.html#errorlog -> /manual/mod/directive-dict.html
http://127.0.0.1/manual/mod/directive-dict.html#Default -> /manual/sections.html
http://127.0.0.1/manual/index.html -> /manual/images/apache_header.gif
http://127.0.0.1/manual/index.html -> /manual/images/pixel.gif
9. agent_log
Lynx/2.8.5dev.2 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6a
Mozilla/4.78 [en] (X11; U; Linux 2.4.8-26mdk i586)
Lynx/2.8.5dev.2 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6a
Links (0.96; Linux 2.4.8-26mdk i586)
Mozilla/5.0 (compatible; Konqueror/2.2.1; Linux)
Demikianlah sedikit sumbangan dari saya, semoga tutorial singkat ini membantu Linuxer
klas-talk.
Asalamualaikum Wr Wb
Budi Santosa
--
_______________________________________________
Get your free email from http://www.graffiti.net
Powered by Outblaze