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

The way apache reads the log

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Editor to share with you the method of apache to read the log, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Introduction of Apache log file name and path (recommended learning: use of apache)

When we install and start Apache, Apache automatically generates two log files, access _ log (access.log on Windows) and error _ log (error.log on Windows).

If you use the SSL service, there may also be three log files, ssl_access_log and ssl_error_log and ssl_request_log.

The path of the log file varies according to the installation method. It is generally located in the logs subdirectory of the Apache installation directory. The log file path can be found in the Apache configuration file according to the actual installation.

View the server log method

In the server maintenance, often encounter a variety of errors, constantly check the server log, you can easily know what went wrong. Connect to the server remotely with ssh, and then enter the following command to dynamically display the last few lines of the error log to facilitate troubleshooting.

Tail-f / usr/local/apache/logs/error_log

No matter which method is used, it is a good habit to open multiple terminal windows at the same time: for example, to display the error log in one window and the access log in another window. In this way, we can keep abreast of what is happening on the website and solve it immediately.

There is a lot of information that can be recorded in log files, including:

(1) the address of the remote machine: "the address of the remote machine" is similar to "who is browsing the website", but not the same.

(2) browsing time: when does the viewer start visiting the website? We can learn a lot from the answer to this question. The information available from a single access record is very limited, but if we start from thousands of access records, we can get very useful and important statistics.

(3) Resources visited by users: which parts of the website are most popular with users? These are the most popular parts that we should continue to develop. Which parts of the site are always left out? Maybe these neglected parts of the site are hidden too deeply, or maybe they are really meaningless, so we have to find ways to improve them. Of course, the content of the site, such as legal statements, is rarely visited, but it should not be changed casually.

(4) invalid links: of course, log files can also tell us what doesn't work as we imagined. Are there any wrong links in the site? Are there any mistakes in URL when other websites link to us? Are there any CGI programs that are not working properly? Is there a search engine search program that sends out thousands of requests per second, thus affecting the normal service of this website? The answers to these questions can be found in the log files.

The above is all the contents of apache's method of reading the log, thank you for your reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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