In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will share with you about the configuration instructions that affect access.log. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
10 configuration instructions that affect access.log
1 log_icp_queries
This directive is activated by default, causing squid to record all ICP queries. If you are running a busy parent cache, this may make
The access.log file becomes huge. To save disk space, the directive can be disabled:
Log_icp_queries off
2 emulate_httpd_log
Access.log files are available in two formats: the normal format and the original format. The common format is like most HTTP servers (such as Apache)
The log format is the same. It contains less information than the original format of Squid. However, if you run Squid in proxy mode see
Chapter 15), you may want the normal log file format. The common format may also be useful for your existing log file analysis tools. Use the
Directive to activate the normal format:
Emulate_httpd_log on
3 log_mime_hdrs
Use log_mime_hdrs to have squid record the headers of HTTP requests and responses:
Log_mime_headers on
When activated, squid appends request and response headers to access.log. This adds 2 fields to each row. Each domain is referenced in square brackets
Get up, easy to analyze. Some characters are encoded to make the log file readable. Table 13-2 shows these coding schemes.
Table 13-2. Character encoding rules for HTTP headers in access.log
Character
Encoding
Newline
\ n
Carriage return
\ r
Backslash
\\
[
5b
]
5d
%
25
ASCII 0-31
% xx (hexadecimal value)
ASCII 127255
% xx (hexadecimal value)
4 log_fqdn
Squid puts the client IP address in access.log by default. You can also record the available hostnames and activate the following instructions:
Log_fqdn on
This allows Squid to launch a reverse DNS query on the client's address when it receives the request. If the hostname is found when the request is completed
Squid puts it in the third domain.
5 ident_lookup_access
The list of access rules determines whether Squid initiates an RFC 1413 identity query on the client's TCP connection. By default, Squid does not
An identity query will be issued. To activate this, simply add one or more rules:
Acl All src 0/0
Ident_lookup_access allow All
If the answer is found when the request is completed, Squid puts it in domain 8. If HTTP authentication is used at the same time, the result from the verification is using the
The account name replaces the identity query answer.
6 log_ip_on_direct
When Squid forwards the cache to the original server, it records the IP address of the original server in domain 9. This directive can be prohibited.
So that squid records the hostname:
Log_ip_on_direct off
In this case, the hostname comes from URI. If URI contains an IP address, Squid does not translate it to a hostname.
7 client_netmask
This directive exists mainly to protect the privacy of users. Unlike recording a complete IP address, you can also mask some bits. For example:
Client_netmask 255.255.255.0
With this setting, the last octet of all client IP addresses in access.log is 0:
1066036246.918 35 163.11.255.0 TCP_IMS_HIT/304 266 GET http://..
8 strip_query_terms
This directive is another privacy protection feature. Squid deletes the query condition before recording the request. If the log file unfortunately falls into the wrong hands
Hand, they won't find any usernames and passwords. When the instruction is activated, in the question mark (?) All bytes after that are deleted. For example, some
The URI is as follows:
Http://auto.search.msn.com/response.asp?MT=www.kim o.com.yw&srch=3&prov=&utf8
Will be recorded as:
Http://auto.search.msn.com/response.asp?
. 9 uri_whitespace
I mentioned earlier the problem of space characters that appear in some URI. RFC states that URI must not include space characters, but in practice
This is not the case. The uri_whitespace directive indicates how Squid handles this situation. The allowed setting is: strip (default)
Deny, allow, encode, and chop. In these settings, strip,encode and chop guarantee that the Uri field does not contain any spaces
Characters (space characters add extra fields to access.log).
The allow setting allows requests to pass through Squid without modification. It is likely to cause trouble for the redirector and log file parser. With it
The opposite is the deny setting, which causes Squid to reject such a request. The user will receive an error message, but the request will still be called with a space character
Log to access.log.
If set to encode,Squid, space characters are encoded according to the RFC 1738 specification. In fact, the user agent should do this first.
The chop setting causes Squid to truncate the URI after the first space character.
The default setting is strip, which allows Squid to remove space characters from URI. This ensures that the log file parser and redirector work properly, but
It can destroy some things, such as incorrectly coded search engine queries.
10 buffered_logs
By default, Squid forbids writing buffer for cache.log files, which allows you to run the tail-f command to watch the log files change in real time.
Change. If you think this leads to unnecessary performance overhead, you can disable buffer:
Buffered_logs off
However, unless you run Squid in full debug mode, this may not matter. Note that this option only affects cache.log. Other
Log files are always written in an unbuffered way
I'm sorry, because you posted illegal information in NetEase photo album, the account is blocked. No one can access your album while you are blocked.
Thank you for reading! This is the end of this article on "what are the configuration instructions that affect access.log?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.