Access logs do not log static files
Press F12 to locate the network by default
Refresh the Web page again
Each row is an element
To modify a virtual host configuration file
SETENVIF Environment env=!img
Verify
Images are displayed after uploading pictures
There's no PNG in the log.
Configure the expiration time for a static element
To modify a virtual host configuration file
Edit Master Profile Open expires module
See if the module is turned on
Verify
Remove module
Verify that there is no expiration time again
Agent IP and real client IP are recorded in Apache log
By default, the log log format is:
Logformat "%h%l%u%t \"%r\ "%>s%b \"%{referer}i\ "\"%{user-agent}i\ "" combined
Where%h is the IP of the record visitor, if there is a layer of proxy in the front of the web, then this%h is actually the IP of the proxy machine, this is not what we want. In this case,
The%{x-forwarded-for}i field records the client's true IP. So log logs should read:
Logformat "%h%{x-forwarded-for}i%l%u%t \"%r\ "%>s%b \"%{referer}i\ "\"%{user-agent}i\ "" combined
Apache logs only the specified URI
My need is to www.aaa.com/aaa/a similar request ... The log is logged only for such requests.
Add in httpd.conf or the associated virtual host configuration file
Setenvif Request
URI "^/aaa/.*" aaa-request
Customlog "|/usr/local/apache/bin/rotatelogs-l/usr/local/apache/logs/aaa-access%y%m%d.log 86400 "Combined env=aaa-request
That's all you can do. This principle is the same as the log (http://www.lishiming.net/thread-561-1-1.html) that does not record static access such as images.
Apacheri Access log records