|
.
: http://www.arcetri.astro.it/manual/ja/logs.html
: Mon Jan 21 19:44:30 2013 : Thu Feb 27 23:36:09 2014 : IBM-866 : http www.badastronomy.com phpbb index.php |
Apache HTTP ²î î¦Á 2.2

| ¦î | |
|---|---|
ErrorLog
²îî
Apache µ
١î̒²î
²î
ֵۦ
îۦ ( unix §µ
error_logWindows OS/2 error.log)
Unix §µî syslog
îۦԑۦ îÁ ¨î¦
[Wed Oct 11 14:32:52 2000] [error] [client 127.0.0.1]
client denied by server configuration:
/export/home/live/ap/htdocs/test
Á¨î¦Ȩ
î
LogLevel
ȴîîȴ
î١Á IP µ
¨î¦²îÁ¨µ
²îµۦ (µ) §µ
µ
ے¨î¦îϬ
î CGI µ
ǡۦCGI µ stderr ۦ
ۇîî
 µîÁ Á¨µ Á¨µµîµî 403 Á¨µµ¡í îʴ
µ١ î Unix §µ
tail -f error_log
| ¦î | |
|---|---|
²î¨µ²îµ
̒¨µ CustomLog
LogFormat
¨§Á¨µ
̒²îֵ
¨µ ۦے ²î î§Á Open Directory Yahoo
î¦Á Apache httpd mod_log_config,
mod_log_agent, TransferLog
¦î¨µÁ
ȴCustomLog
í
¨µۦí
ۦ C printf(1) î
î
î mod_log_config ۦ
¨µ
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/access_log common
î common
îî
î¨Áî¨Á
²îÁî
ǡۇî
(") ۦ
î
ؒµ§µî
îԵ "\n"
"\t" ɵȴ
CustomLog
î
¨µµ§
ServerRoot ۦµ
ɑ
Common Log Format (CLF) Ѯ ÁۦՐ²î CLF Á:
127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET
/apache_pb.gif HTTP/1.0" 200 2326
Áс
127.0.0.1 (%h)HostnameLookups
On ²îµ
IP µۦ̒
²î
logresolve
µ
IP µî´§Á
î
µ§Á§
µ- (%l)identd RFC 1413 Á
Á
î
Apache IdentityCheck
On frank (%u)REMOTE_USER
ҐՐµµîµî
() 401 î´
絔
Á "-"
[10/Oct/2000:13:55:36 -0700]
(%t)
[day/month/year:hour:minute:second zone]
day = 2*digit
month = 3*letter
year = 4*digit
hour = 2*digit
minute = 2*digit
second = 2*digit
zone = (`+' | `-') 4*digit
%{format}t
Ȩ
format C
strftime(3)
"GET /apache_pb.gif HTTP/1.0"
(\"%r\")GET Á
îµ /apache_pb.gif
Á HTTP/1.0
µ
î "%m %U%q %H"
µ
"%r" ǡ200 (%>s)2326 (%b)-" ÁÁ
"0" %b
%B ۦ Combined Log Format Ѯ
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-agent}i\"" combined
CustomLog log/access_log combined
ۦֵ Common Log Format
ÁÁî¨Á
%{header}i
header HTTP µۦ
¨µ:
127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET
/apache_pb.gif HTTP/1.0" 200 2326
"http://www.example.com/start.html" "Mozilla/4.08 [en]
(Win98; I ;Nav)"
Á:
"http://www.example.com/start.html"
(\"%{Referer}i\")/apache_pb.gif Á
î¦)"Mozilla/4.08 [en] (Win98; I ;Nav)"
(\"%{User-agent}i\")Ր¨µՐ CustomLog
ۦ
¨µߡ CLF
referer ´
CustomLog
ReferLog
AgentLog ʵֵ
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/access_log common
CustomLog logs/referer_log "%{Referer}i -> %U"
CustomLog logs/agent_log "%{User-agent}i"
Áµɵߡ¨µÁ
Áֵ ҐՐ Ϭ
µҐՐ
SetEnvIf
CustomLog
env= ҐՐµ
:
# Mark requests from the loop-back interface
SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog
# Mark requests for the robots.txt file
SetEnvIf Request_URI "^/robots\.txt$" dontlog
# Log what remains
CustomLog logs/access_log common env=!dontlog
ˑµµ
SetEnvIf Accept-Language "en" english
CustomLog logs/english_log common env=english
CustomLog logs/non_english_log common env=!english
Á ȴֵ ²îֵ̒ ֵ
ͧ²î ¨µ 10,000 µ 1 MB ۃ²î Apache open ۦ open ²î
²î§Á §Á open Ϭ²îµ ɑۦ ۃµ §:
mv access_log access_log.old
mv error_log error_log.old
apachectl graceful
sleep 600
gzip access_log.old error_log.old
ۃֵԑ
Apache httpd ۇۦ
ۦǡ
í²îî
Áۦ
"|"
Áۦ
Apache ԑ¨µ²î
²î§
(íԑÁ
Ѯԑ)
ԑ¨µ Apache httpd ¨µ ¨µî´ ID Ƀԑ root с
ԑ²îۃ
Apache HTTP ²î rotatelogs Ѯ
24 ۃ
:
CustomLog "|/usr/local/apache/bin/rotatelogs
/var/log/access_log 86400" common
ѮÁے ¨µî
cronolog ۃ ²
Áԑ ŧÁֵ ֵ
îµ ²î
ɑֵֵ
µ²î
Á²îÁµ
<VirtualHost> ¨§Á
¨µî
îµ
CustomLog
ErrorLog
<VirtualHost>
î
µµî
Áîµ
Ĵµ²î
îµµՐ
¨µîµ îµ µɒ
LogFormat "%v %l %u %t \"%r\" %>s %b"
comonvhost
CustomLog logs/access_log comonvhost
%v µɑîµ
split-logfile
¨µ
îµɒ
î îµî îµî
| ¦î | |
|---|---|
mod_logio
îՐ
î (%I %O)
LogFormat
mod_log_forensic Áµ
forensic µ
1 µ 2 ǡ
forensic 
¨îʵ
Apache httpd ¨µ¨µ ID
logs/httpd.pid
PidFile
ۇ¨µ ID ¨µ
§îÁ
Windows -k Á§Á
î¦
ScriptLog
CGI µǡ̒
µ²î
mod_cgi ۦ
mod_rewrite
í
RewriteLog
Á¦Áµ
ۦֵǡ RewriteLogLevel
ȴ