09/27/13

apache 404处理机制

1、tail -f access.0927|awk -F ‘”‘ ‘{print $3″ “$2}’|awk ‘{if($1==404) print $0}’ >list.txt

2、list.txt

404 318 138  GET /app2/styles/gn/200/365.jpg HTTP/1.0
404 318 195  GET /app2/styles/gn/200/401.jpg HTTP/1.0
404 318 160  GET /app2/styles/gn/200/402.jpg HTTP/1.0
404 318 131  GET /app2/styles/gn/200/389.jpg HTTP/1.0
404 318 153  GET /app2/styles/gn/200/385.jpg HTTP/1.0
404 318 121  GET /app2/styles/gn/200/382.jpg HTTP/1.0
404 318 156  GET /app2/styles/gn/200/383.jpg HTTP/1.0
404 318 153  GET /app2/styles/gn/200/388.jpg HTTP/1.0
404 318 126  GET /app2/styles/gn/200/361.jpg HTTP/1.0
404 318 159  GET /app2/styles/gn/200/365.jpg HTTP/1.0
404 318 198  GET /app2/styles/gn/200/368.jpg HTTP/1.0
404 318 186  GET /app2/styles/gn/200/361.jpg HTTP/1.0
404 318 121  GET /app2/styles/gn/200/365.jpg HTTP/1.0
404 318 233  GET /app2/styles/gn/200/376.jpg HTTP/1.0
404 318 142  GET /app2/styles/gn/200/382.jpg HTTP/1.0
404 318 192  GET /app2/styles/gn/200/369.jpg HTTP/1.0
404 318 196  GET /app2/styles/gn/200/366.jpg HTTP/1.0
404 318 197  GET /app2/styles/gn/200/383.jpg HTTP/1.0
404 318 234  GET /app2/styles/gn/200/365.jpg HTTP/1.0
404 318 183  GET /app2/styles/gn/200/402.jpg HTTP/1.0

 

3、awk ‘{print $5}’ list.txt |awk -F ‘/’ ‘{print $NF}’|xargs -i touch {}

 

09/27/13

apache 配备规则

下列指令都起作用的话,则会按A > B > C > D > E的顺序依次生效。

<Location />
E
</Location>

<Files xxx.html>
D
</Files>

<VirtualHost *>
<Directory /a/b>
B
</Directory>
</VirtualHost>

<DirectoryMatch “^.*b$”>
C
</DirectoryMatch>

<Directory /a/b>
A
</Directory>