Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Configuration and use of Apache access Log

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

We are using the second section configuration under the / usr/local/apache2.4/conf/extra/httpd-vhosts.conf configuration file, whose log is under / usr/local/apache2.4/logs/

# cat / usr/local/apache2.4/logs/111.com-access_log / / check its log. When GET is not added with-I, HEAD only displays the status code after adding-I. the log details include: source IP, time, behavior, domain name accessed, version of http, status code.

The log format can be customized and configured in the main configuration file

# vim / usr/local/apache2.4/conf/httpd.conf

2 log format is provided in the configuration file, and common is used by default

% h indicates that the source ip,%l and% u are users,% t is time,% r is behavior,% s is status code,% b is size

In addition to these functions, the other format also has user-agent user agent. Referer refers to a string of URLs searched before visiting it, which will be logged at the site you visit.

# vim / usr/local/apache2.4/conf/extra/httpd-vhosts.conf / / configure log format

Change CustomLog "logs/111.com-access_log" common to CustomLog "logs/111.com-access_log" combined

# / usr/local/apache2.4/bin/apachectl-t

# / usr/local/apache2.4/bin/apachectl graceful

# cat / usr/local/apache2.4/logs/111.com-access_log

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report