摘要:hellopassdw
访问日志不记录指定类型的文件
网站大多元素为静态文件,如图片,css,js等,这些元素可以不用记录
把虚拟主机配置文件改成如下:
hellopassdw
访问日志不记录指定类型的文件 网站大多元素为静态文件,如图片,css,js等,这些元素可以不用记录 把虚拟主机配置文件改成如下: <VirtualHost :80> DocumentRoot "/data/wwwroot/www.111.com ServerName www.111.com ServerAlias 111.com SetEnvIf Request_URI "..gif$" img SetEnvIf Request_URI "..jpg$" img SetEnvIf Request_URI "..png$" img SetEnvIf Request_URI "..bmp$" img SetEnvIf Request_URI "..swf$" img SetEnvIf Request_URI "..js$" img SetEnvIf Request_URI "..css$" img CustomLog "logs/111.com-access_log" combined env=!img </VirtualHost> 重新加载配置文件-t,graceful mkdir /data/wwwroot/www.111.com/images #创建目录,并在这目录下上传一个图片 curl -x 127.0.0.1:80 -I 111.com/images/111.jpg tail /usr/local/apache2.4/logs/111.com_access_log
[root@localhost ~]# vi /usr/local/apache2.4/conf/extra/httpd-vhosts.conf # </FilesMatch> 43 # </Directory> 44 <IfModule mod_rewrite.c> 45 RewriteEngine on 46 RewriteCond %{HTTP_HOST} !^111.com$ 47 RewriteRule ^/(.*)$ http://111.com/$1 [R=301,L] 48 </IfModule> 49 ErrorLog "logs/111.com-error_log" 50 SetEnvIf Request_URI ".*.gif$" img 51 SetEnvIf Request_URI ".*.jpg$" img 52 SetEnvIf Request_URI ".*.png$" img 53 SetEnvIf Request_URI ".*.bmp$" img 54 SetEnvIf Request_URI ".*.swf$" img 55 SetEnvIf Request_URI ".*.js$" img 56 SetEnvIf Request_URI ".*.css$" img 57 CustomLog "logs/111.com-access_log" combined env=!img 58 </VirtualHost>
[root@localhost ~]# curl -x 127.0.0.1:80 111.com/1111.jpg -I HTTP/1.1 404 Not Found Date: Sat, 04 Nov 2017 13:27:47 GMT Server: Apache/2.4.29 (Unix) PHP/5.6.30 Content-Type: text/html; charset=iso-8859-1
[root@localhost ~]# tail /usr/local/apache2.4/logs/111.com-access_log 127.0.0.1 - - [04/Nov/2017:14:33:52 +0800] "HEAD http://111.com/user.php HTTP/1.1" 200 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:14:34:03 +0800] "GET http://111.com/user.php HTTP/1.1" 200 10 "-" "curl/7.29.0" 192.168.9.1 - - [04/Nov/2017:14:35:24 +0800] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36" 192.168.9.1 - - [04/Nov/2017:14:35:25 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:44:00 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:50:27 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:50:49 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:51:04 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 127.0.0.1 - - [04/Nov/2017:21:27:15 +0800] "HEAD HTTP://111.com HTTP/1.1" 200 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:21:27:47 +0800] "HEAD HTTP://111.com/1111.jpg HTTP/1.1" 404 - "-" "curl/7.29.0"
[root@localhost ~]# /usr/local/apache2.4/bin/apachectl -t Syntax OK [root@localhost ~]# /usr/local/apache2.4/bin/apachectl graceful [root@localhost ~]# curl -x 127.0.0.1:80 111.com/1111.jpg -I HTTP/1.1 404 Not Found Date: Sat, 04 Nov 2017 13:30:09 GMT Server: Apache/2.4.29 (Unix) PHP/5.6.30 Content-Type: text/html; charset=iso-8859-1
[root@localhost ~]# tail /usr/local/apache2.4/logs/111.com-access_log 127.0.0.1 - - [04/Nov/2017:14:33:52 +0800] "HEAD http://111.com/user.php HTTP/1.1" 200 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:14:34:03 +0800] "GET http://111.com/user.php HTTP/1.1" 200 10 "-" "curl/7.29.0" 192.168.9.1 - - [04/Nov/2017:14:35:24 +0800] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36" 192.168.9.1 - - [04/Nov/2017:14:35:25 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:44:00 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:50:27 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:50:49 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:51:04 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 127.0.0.1 - - [04/Nov/2017:21:27:15 +0800] "HEAD HTTP://111.com HTTP/1.1" 200 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:21:27:47 +0800] "HEAD HTTP://111.com/1111.jpg HTTP/1.1" 404 - "-" "curl/7.29.0"
[root@localhost ~]# curl -x 127.0.0.1:80 111.com/1111.jpg1 -I HTTP/1.1 404 Not Found Date: Sat, 04 Nov 2017 13:30:59 GMT Server: Apache/2.4.29 (Unix) PHP/5.6.30 Content-Type: text/html; charset=iso-8859-1 [root@localhost ~]# tail /usr/local/apache2.4/logs/111.com-access_log 127.0.0.1 - - [04/Nov/2017:14:34:03 +0800] "GET http://111.com/user.php HTTP/1.1" 200 10 "-" "curl/7.29.0" 192.168.9.1 - - [04/Nov/2017:14:35:24 +0800] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36" 192.168.9.1 - - [04/Nov/2017:14:35:25 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:44:00 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:50:27 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:50:49 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:51:04 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 127.0.0.1 - - [04/Nov/2017:21:27:15 +0800] "HEAD HTTP://111.com HTTP/1.1" 200 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:21:27:47 +0800] "HEAD HTTP://111.com/1111.jpg HTTP/1.1" 404 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:21:30:59 +0800] "HEAD HTTP://111.com/1111.jpg1 HTTP/1.1" 404 - "-" "curl/7.29.0
[root@localhost ~]# curl -x 127.0.0.1:80 111.com/1111 -I HTTP/1.1 404 Not Found Date: Sat, 04 Nov 2017 13:31:43 GMT Server: Apache/2.4.29 (Unix) PHP/5.6.30 Content-Type: text/html; charset=iso-8859-1 [root@localhost ~]# tail /usr/local/apache2.4/logs/111.com-access_log 192.168.9.1 - - [04/Nov/2017:14:35:24 +0800] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36" 192.168.9.1 - - [04/Nov/2017:14:35:25 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:44:00 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:50:27 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:50:49 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:51:04 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 127.0.0.1 - - [04/Nov/2017:21:27:15 +0800] "HEAD HTTP://111.com HTTP/1.1" 200 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:21:27:47 +0800] "HEAD HTTP://111.com/1111.jpg HTTP/1.1" 404 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:21:30:59 +0800] "HEAD HTTP://111.com/1111.jpg1 HTTP/1.1" 404 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:21:31:43 +0800] "HEAD HTTP://111.com/1111 HTTP/1.1" 404 - "-" "curl/7.29.0"
[root@localhost ~]# cd /data/wwwroot/111.com/ [root@localhost 111.com]# ls index.php user.php [root@localhost 111.com]# rz
上传一张图片为1111.png
[root@localhost 111.com]# ls 1111.png index.php user.php [root@localhost 111.com]# curl -x 127.0.0.1:80 111.com/1111.png -I HTTP/1.1 200 OK Date: Sat, 04 Nov 2017 13:36:39 GMT Server: Apache/2.4.29 (Unix) PHP/5.6.30 Last-Modified: Sat, 04 Nov 2017 13:36:39 GMT ETag: W/"99ad-560d9271dfe00" Accept-Ranges: bytes Content-Length: 39341 Content-Type: image/png
Windows下访问浏览器111.com/1111.png
[root@localhost 111.com]# tail /usr/local/apache2.4/logs/111.com-access_log 192.168.9.1 - - [04/Nov/2017:14:35:25 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:44:00 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:50:27 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:50:49 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:51:04 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 127.0.0.1 - - [04/Nov/2017:21:27:15 +0800] "HEAD HTTP://111.com HTTP/1.1" 200 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:21:27:47 +0800] "HEAD HTTP://111.com/1111.jpg HTTP/1.1" 404 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:21:30:59 +0800] "HEAD HTTP://111.com/1111.jpg1 HTTP/1.1" 404 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:21:31:43 +0800] "HEAD HTTP://111.com/1111 HTTP/1.1" 404 - "-" "curl/7.29.0" 192.168.9.1 - - [04/Nov/2017:21:37:22 +0800] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36"
[root@localhost 111.com]# vi /usr/local/apache2.4/conf/extra/httpd-vhosts.conf 43 # </Directory> 44 <IfModule mod_rewrite.c> 45 RewriteEngine on 46 RewriteCond %{HTTP_HOST} !^111.com$ 47 RewriteRule ^/(.*)$ http://111.com/$1 [R=301,L] 48 </IfModule> 49 ErrorLog "logs/111.com-error_log" 50 SetEnvIf Request_URI ".*.gif$" img 51 SetEnvIf Request_URI ".*.jpg$" img 52 SetEnvIf Request_URI ".*.png$" img 53 SetEnvIf Request_URI ".*.bmp$" img 54 SetEnvIf Request_URI ".*.swf$" img 55 SetEnvIf Request_URI ".*.js$" img 56 SetEnvIf Request_URI ".*.css$" img 57 CustomLog "logs/111.com-access_log" combined 58 </VirtualHost> [root@localhost 111.com]# /usr/local/apache2.4/bin/apachectl graceful
[root@localhost 111.com]# tail /usr/local/apache2.4/logs/111.com-access_log 192.168.9.1 - - [04/Nov/2017:14:44:00 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:50:27 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:50:49 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:51:04 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 127.0.0.1 - - [04/Nov/2017:21:27:15 +0800] "HEAD HTTP://111.com HTTP/1.1" 200 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:21:27:47 +0800] "HEAD HTTP://111.com/1111.jpg HTTP/1.1" 404 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:21:30:59 +0800] "HEAD HTTP://111.com/1111.jpg1 HTTP/1.1" 404 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:21:31:43 +0800] "HEAD HTTP://111.com/1111 HTTP/1.1" 404 - "-" "curl/7.29.0" 192.168.9.1 - - [04/Nov/2017:21:37:22 +0800] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36" 192.168.9.1 - - [04/Nov/2017:21:41:58 +0800] "GET /1111.png HTTP/1.1" 200 39341 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)"
[root@localhost 111.com]# curl -x 127.0.0.1:80 111.com/1111.png -I HTTP/1.1 200 OK Date: Sat, 04 Nov 2017 13:42:38 GMT Server: Apache/2.4.29 (Unix) PHP/5.6.30 Last-Modified: Sat, 04 Nov 2017 13:42:38 GMT ETag: W/"99ad-560d9271dfe00" Accept-Ranges: bytes Content-Length: 39341 Content-Type: image/png [root@localhost 111.com]# tail /usr/local/apache2.4/logs/111.com-access_log 192.168.9.1 - - [04/Nov/2017:14:50:27 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:50:49 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 192.168.9.1 - - [04/Nov/2017:14:51:04 +0800] "GET /user.php HTTP/1.1" 200 10 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 127.0.0.1 - - [04/Nov/2017:21:27:15 +0800] "HEAD HTTP://111.com HTTP/1.1" 200 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:21:27:47 +0800] "HEAD HTTP://111.com/1111.jpg HTTP/1.1" 404 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:21:30:59 +0800] "HEAD HTTP://111.com/1111.jpg1 HTTP/1.1" 404 - "-" "curl/7.29.0" 127.0.0.1 - - [04/Nov/2017:21:31:43 +0800] "HEAD HTTP://111.com/1111 HTTP/1.1" 404 - "-" "curl/7.29.0" 192.168.9.1 - - [04/Nov/2017:21:37:22 +0800] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36" 192.168.9.1 - - [04/Nov/2017:21:41:58 +0800] "GET /1111.png HTTP/1.1" 200 39341 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)" 127.0.0.1 - - [04/Nov/2017:21:42:38 +0800] "HEAD HTTP://111.com/1111.png HTTP/1.1" 200 - "-" "curl/7.29.0"
43 # </Directory> 44 <IfModule mod_rewrite.c> 45 RewriteEngine on 46 RewriteCond %{HTTP_HOST} !^111.com$ 47 RewriteRule ^/(.*)$ http://111.com/$1 [R=301,L] 48 </IfModule> 49 ErrorLog "logs/111.com-error_log" 50 SetEnvIf Request_URI ".*.gif$" img 51 SetEnvIf Request_URI ".*.jpg$" img 52 SetEnvIf Request_URI ".*.png$" img 53 SetEnvIf Request_URI ".*.bmp$" img 54 SetEnvIf Request_URI ".*.swf$" img 55 SetEnvIf Request_URI ".*.js$" img 56 SetEnvIf Request_URI ".*.css$" img 57 CustomLog "logs/111.com-access_log" combined env=!img 58 </VirtualHost>
使用场景,一般日志保存是请求的页面信息,而不是保存具体到某一张图片,这样不仅会消耗并且浪费磁盘空间,也造成了不必要信息记录,查找会更加麻烦。
修改与171221
相关文章推荐
虚拟主机的专业参数,分别都是什么意思?2022-09-09
中非域名注册规则是怎样的?注册域名有什么用处? 2022-01-10
HostEase新年活动促销 美国/香港主机全场低至五折2021-12-28
HostGator下载完整备份教程分享2021-12-28
Flink中有界数据与无界数据的示例分析2021-12-28