First, the Apache log by day cutting
Copy Code code as follows:
Vi/etc/httpd/conf/httpd.conf
ErrorLog "|rotatelogs/var/log/httpd/%y%m%derror_log 86400 480"
Customlog "|rotatelogs/var/log/httpd/%y%m%daccess_log 86400" combined
Second, restart the Apache
see if there is a build logDate-s "2016-11-21 15:55:20"650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m01/8b/27/wkiom1hfltbs5pxfaaannkwjiz4223.png-wh_500x0-wm_3-wmp_4-s_166256326.png "title= "6.png" alt= "Wkiom1hfltbs5pxfaaannkwjiz4223.png-wh_50"/>Refresh the Web page and generate a new
1. Overview
Currently, log4j has three development branches: one is the stable version of 1.2, the other is the 1.3 version that has stopped development, and the other is the 2.0 version in the experimental phase. According to the Apache log4j official website, on a computer containing an AMD duron CPU running at MHz and using JDK 1.3.1, log4j 1.2 can complete a log statement in 5 nanoseconds as the
Apache eats empty memory, frequent downtimeIn the deployment of a set of intranet test environment, frequent downtime, after the boot constantly eat memory, restart Apache after the memory consumption will continue to rise, until the swap runs out, until the crash, due to the intranet environment, the server concurrency and pressure are very small.Check the Apache
What does [userlimit: warn] in the apache error log mean? The following error is displayed in the log: [Sun nbsp; Aug nbsp; 25 nbsp; 10:35:03 nbsp; 2013] nbsp; [10970692] nbsp; [userlimit: warn] nbsp; [[userlimit: warn] in the client nbsp apache error log refers to w
with '-' representation%t time%r action, GET or post5. Edit the virtual host configuration file to define how the log is cut:DocumentRoot "/tmp/123"ServerName invalid.comDocumentRoot "/data/www"ServerName www.test.comServeralias www.mydiscuz.comServeralias www.others.comErrorlog "Logs/test.com-error_log"Customlog "| /usr/local/apache2/bin/rotatelogs-l/usr/local/apache2/logs/test.com-access_%y%m%d_log 86400 "combinedRewriteengine onRewritecond%{http_h
1. First, cut apache logs by day
Vi/etc/httpd/conf/httpd. confErrorLog "| rotatelogs/var/log/httpd/% Y % m % derror_log 86400 480"CustomLog "| rotatelogs/var/log/httpd/% Y % m % daccess_log 86400 480" combined
Ii. Restart the apache service
Service httpd restart
################# Apahce
Nginx:
Log_format main '$ remote_addr-$ remote_user [$ time_local] "$ request "''$ Status $ body_bytes_sent "$ http_referer "''"$ Http_user_agent" $ request_time ';
Log format description:$ Remote_addr IP Address used for remote request$ Remote_user remote login name$ Time_local time, in common log time format (Standard English format)$ The first line of the request$ Status.$ Body_bytes_sent the number of b
1. First download the log polling tool to install Apache Cronolog:1 wgethttp//cronolog.org/download/cronolog-1.6.2.tar.gz2 3 TarZXVF cronolog-1.6.2.Tar. GZ4 5CD cronolog-1.6.26 7 mkdir-p/usr/local/Cronolog8 9./configure--prefix=/usr/local/CronologTen One Make A - Make InstallCronolog Log Polling Configuration description:Polling by day (common usage in produc
Apache will generate access logs and error logs by default under/usr/local/apache2/logs after the service is available Access_log and error_logIn particular, the access log, in the case of multiple user access, will produce a lot of records. Over time, it may turn into a few g or more than 10 g.In order to alleviate this situation, cutting logs by day, deleting previously useless logs, is a good workaround.
Python analyzes apache and nginx log files and outputs the visitor ip list,
This example describes how to analyze apache and nginx log files in python and output the visitor ip list. Share it with you for your reference. The details are as follows:
Use python to analyze apache
1. First, cut Apache logs by day
VI/etc/httpd/CONF/httpd. confErrorlog "| rotatelogs/var/log/httpd/% Y % m % derror_log 86400 480 ″Customlog "| rotatelogs/var/log/httpd/% Y % m % daccess_log 86400 480" combined
Ii. Restart Apache server
Service httpd restart
################# Apahce
Parse Apache log file, regular expression
/** Copyright (c) Ian F. Darwin, http://www.darwinsys.com/, 1996-2002.* All rights reserved. Software written by Ian F. Darwin and others.* $Id: license,v 1.8 2004/02/09 03:33:38 Ian Exp $** Redistribution and use in source and binary forms, with or
Linux running Web server Apache, the default log file is not split, an entire file is not easy to manage, and not easy to analyze statistics. After installing Cronolog, you can split the log files by time, which is easy to manage and analyze. Cronolog installation configuration is very simple, after downloading only need to enter a few commands to complete.1. Dow
[Email protected] ~]# vim/usr/local/apache2/conf/extra/httpd-vhosts.conf650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/79/0B/wKiom1aFRH6w3lq9AAA06EYUr9E441.png "title=" Qq20151231231320.png "alt=" Wkiom1afrh6w3lq9aaa06eyur9e441.png "/>common represents the type name of the access log, we look at a configuration file, in the main profile we can see the format of the log, Name lookup/common650) th
Article title: fcntl: F_SETLKW: Norecordlocksavailable in the apache error log. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Problem: The server is suspended or cannot be started. the error log contains "fcntl: F_SETLKW: N
What we're saying here about Apache's log is the thing about the access log! To prevent log files from being too large, we archive the logs on a daily basis!Vim/usr/local/apache2/conf/extra/httpd-vhosts.confOpen the virtual machine configuration file and remove the # number in front of the following two linesErrorlog "Logs/dummy-host2.example.com-error_log" Custo
In the Apache access log, all actions are logged by default. Includes some local static small pictures, so the log becomes bloated.At this point we can specify that the log of the specified file type is not logged, so that only the log we want is logged.Configuration steps:1
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.