One, Apache access logs do not log static filesMost of the site elements are static files, tablets, CSS, JS, etc., these elements can not be recordedvim/usr/local/apache2.4/conf/extra/httpd-vhosts.conf//Change to the followingChange the virtual host configuration file to the following:DocumentRoot "/data/wwwroot/www.123.com"ServerName www.111.comServeralias 111.comSetenvif Request_uri ". *\.gif$" imgSetenvi
Operation Steps:One: Define the format of the log in the Apache master configuration fileVim/usr/local/apache2/conf/httpd.confLogformat "%h%l%u%t \"%r\ "%>s%b \"%{referer}i\ "\"%{user-agent}i\ "" combinedLogformat "%h%l%u%t \"%r\ "%>s%b" commonLogformat "%h%l%u%t \"%r\ "%>s%b" AlexNote: First define the output format and alias (combined, Common, Alex) of the log
11.18 Apache user authentication11.19/11.20 Domain Jumphttpd.conf, delete the # in front of Rewrite_module (shared)Curl-x127.0.0.1:80-i 123.com//Status Code 30111.21 Apache Access LogChange the virtual host configuration file to the following:DocumentRoot "/data/wwwroot/lgx168.com"ServerName lgx168.comServeralias www.lgx168.comCustomlog "Logs/lgx168.com-access_log" combinedReload the configuration file-t,gr
, hostname (domain name) is not www.123.com meet conditionRewriterule ^/(. *) $ http://www.123.com/$1 [r=301,l]//define rewrite rules that are not executed until the above conditions are met/usr/local/apache2/bin/apachectl-m|grep-i rewrite//Without this module, you need to edit the configuration file httpd.conf, delete the front of the Rewrite_module (shared) #Curl-x127.0.0.1:80-i 123.com//Status Code 30111.21 Configuring access LogsAccess log records
Apache Log Split1. Configure HTTPD master configuration, create a file ending with Conf in the HTTPD sub-configuration directory, and add configuration information2. Create directory, add homepage, restart Service, turn off firewall3, visit the webpage, more refresh several times, view the access logApache Log Analysis1, the Awstats tool decompression, and mobile
User authentication for Apachevim/usr/local/apache2.4/conf/extra/httpd-vhosts.conf//The 111.com virtual host is edited into the following contentDocumentRoot "/data/wwwroot/111.com"ServerName 111.comServeralias www.example.comAllowOverride authconfigAuthName "111.com User auth"AuthType Basicauthuserfile/data/.htpasswdRequire Valid-userErrorlog "Logs/111.com-error_log"Customlog "Logs/111.com-access_log" commonApache Authentication for individual filesvim/usr/local/apache2.4/conf/extra/httpd-vhost
Overview:
in distributed systems, it is often necessary to collect the logs of each node and then unify the analysis.
This article provides a simple solution, this article uses the Open source log project + the unified database structure way, In each development environment, provide a unified configuration and invocation methods, all logs are recorded in the log server, you can trace the query on any one
Apache user authenticationOpen the site directly pop-up user name password, correct before you can view the site, this is called Apache user authentication.Edit the configuration file (because we are using Apache virtual host, so we enter the configuration of the virtual host)vim /usr/local/apache2.4/conf/extra/httpd-vhosts.confAdd the following paragraph to the
Rotatelogs is the pipe logger that came with Apache 2.2.
Grammar
Copy Code code as follows:
Rotatelogs [-l] logfile [rotationtime [offset]] | [Filesizem]
Options-LUse local time instead of GMT time as a time benchmark. Note: using-l in an environment that changes the GMT offset (such as daylight saving time) can lead to unpredictable results.
LogFileIt plus the reference name is the log
, Emerg.#LogLevel warn
=====================LogLevel parameters can be seen above. (see errorlog directives).The default level is warn, then logs above warn level will be logged, resulting in a large number of Erro-level error logs that "file does not exist". It is recommended that you use the Crit level setting to record only the logs above the fatal level, effectively reducing the number of logs.
Change the loglevel warn to loglevel crit and restart
I want to solve the Linux system on the Apache WEB server error, apache error log files can not find, I would like to put in which directory?The Apache log file provides system administrators with useful information, such as troubleshooting the WEB server, protecting the sys
Tags: logHave not found Apache log file generated more than a day, not generally big, if you Apache installed in the C drive, that can be miserable, not a few days hard disk is full, too scary, there is no way to optimize the log, so it is not so big? The answer is yes.First, stop the
Apache logs do not record Image File Settings
Setenv imag 1Customlog logs/access_log combined Env =! Imag
Apache logs: If you record all access requests, the file will be large. If you use log analysis software, the analysis results may not be accurate. In addition, if you do not install the cronolog tool to truncate the log
I. Log Analysis
If Apache is installed by default, two log files are generated when the server runs. The two files are access_log and error_log.
When the default installation method is used, these files can be found under/usr/local/Apache/logs.
Access_log is the access log,
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.