One, analysis Apache log
1, there is a document SHELL.SH, the contents are as follows:
[Root@test3root] #catshell. sh
Http://www.baidu.com/index.html
Http://www.google.com/index.html
Http://www.baidu.com/get.html
Http://www.baidu.com/set.html
Http://www.google.com/index.html
Http://www.yahoo.com.cn/put.html
It is now required to intercept the domain name in the file, to count the number of occurren
Suppose the Apache log format is:
118.78.199.98–-[09/jan/2010:00:59:59 +0800] "Get/public/css/index.css http/1.1″304–" http://www.a.cn/common/ index.php "
" mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; GTB6.3) "
Issue 1: Find the most visited 10 IP in Apachelog.
awk ' {print $} ' apache_log |sort |uniq-c|sort-nr|head-n 10awk first grabs the IP from each
^/(. *) $ http://sdw.com/$1 [r=301,l]#//defines the rewrite rule, which executes when the above conditions are metAllowOverride authconfigAuthName "123.com User auth"AuthType Basicauthuserfile/data/.htpasswdRequire Valid-userErrorlog "Logs/sdw.com-error_log"Customlog "Logs/sdw.com-access_log" common2. Modify the configuration[Email protected] ~]# vim/usr/local/apache2/conf/httpd.confLoadModule rewrite_module modules/mod_rewrite.so//Remove # To enable this module3. Test results[Email protected]
• Add Customlog "|/usr/local/apache2/bin/rotatelogs-l/usr/local/apache2/logs/access_%y%m%d.log 86400" to the virtual host configuration file Combined First paragraph: Rotatelog tool path The second paragraph: Log storage path and naming (by month and day name) Third paragraph: Call the log format in httpd.conf to combined format3. Static caching define picture, CSS, JS, SWF expiration time · Module use
/usr/local/apache2/bin/apachectl-m: See which modules are installed/usr/local/apache/bin/apachectl-v: Viewing the mode used/usr/local/apache2/bin/apachectl-t: Checking for syntax errors/usr/local/apache2/bin/apachectl-l: Viewing the installed library files/usr/local/apache2/bin/apachectl Graceful: Reload configuration/usr/local/apache2/htcocs Home Store Directory/usr/local/apache2/bin/apachectl Startup file directory/usr/local/apache2/conf configurati
Suppose the Apache log format is:118.78.199.98–-[09/jan/2010:00:59:59 +0800] "Get/public/css/index.css http/1.1″304–" http://www.a.cn/common/ index.php "" mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; GTB6.3) "Issue 1: Find the 10 most visited IPs in Apachelog.awk ' {print '} ' apache_log |sort |uniq-c|sort-nr|head-n 10awk first grabs the IP in each log
Suppose the Apache log format is:118.78.199.98–-[09/jan/2010:00:59:59 +0800] "Get/public/css/index.css http/1.1″304–" http://www.a.cn/common/ index.php "" mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; GTB6.3) "Issue 1: Find the 10 most visited IPs in Apachelog.awk ' {print '} ' apache_log |sort |uniq-c|sort-nr|head-n 10awk first grabs the IP in each log
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
zip format, not an MSI installation version, you need to register the service, in order to have a httpd icon in the desktop taskbar. Results in the CMD command line entered the installation Service command error, error, error message prompts me not to log in as an administrator!
Solution: Will cmd run as an administrator, and then re-enter the command, after the successful execution, can be found in the system services APACHE24 this service.
Then c
parenthesis inside a regular expression.Well, the cookie in the Nginx log is probably the way it is.ApacheNginx configuration on the network more articles, but Apache relatively few. Explain my method, the principle is the same, but there are some differences in grammar.Apache has preset a way to get a cookie field:%{varname}c, so it's relatively simple to configure.Edit the httpd.conf to find the followin
. ___________________________________________________________Log polling production environment actual configuration___________________________________________________________Actual configuration of common production environments polled by day:[[emailprotected]_server]vim/usr/local/apache2/conf/extra/httpd-vhosts.conf___________________________________________________________Logging proxy IP and real client:[[emailprotected]_server~]#vim/usr/local/apache2/conf/httpd.conf #LogFormat "%h%l%u%t\"
When doing the project, sometimes need to look at the Apache error log, and then need to be very cumbersome to open the directory below, look at the information, only when the wrong time I will open the file.But recently I found that in the development of the time, I ignored a lot of errors, although not cause errors, but can not be a day to explode.I am not happy every time I open that file, and then I hav
|uniq-c | awk ' {if (>) print $} ' | LessStatistics a URL, the number of visits per day#cat access_log|grep ' 12/aug/2009′|grep '/images/index/e1.gif ' |wc|awk ' {print $} 'Most visited pages in the first five days#cat Access_log|awk ' {print $7} ' |uniq-c |sort-n-r|head-20See what the IP is doing in the log.#cat Access_log | grep 218.66.36.119| awk ' {print $1″\t ' $7} ' | Sort | uniq-c | Sort-nr | LessList files that have been transmitted for longe
PHP environment configuration-download the Apache Server for windows and phpapache from the apache official website. PHP environment configuration-download the Apache Server for windows from the apache official website. phpapache
: This article mainly introduces the PHP environment configuration-download the windows Apache server from the apache official website. if you are interested in the PHP Tutorial, refer to it. As I am forced to download software, I like to download it from the official website. after a long time, I finally figured out h
1. Take access to the top 10 IP addressCat Access.log|awk ' {print '} ' |sort|uniq-c|sort-nr|head-10Cat Access.log|awk ' {counts[$ (11)]+=1}; END {for (URL in counts) print Counts[url], url} '2. Most visited files or pages, such as get top 10Cat Access.log|awk ' {print $11} ' |sort|uniq-c|sort-nr|head-103. Output transmission of the largest number of EXE files, in the analysis of the download station will be usedCat Access.log |awk ' ($7~/.exe/) {print $ "" $ "" $4 "" $7} ' |sort-nr|head-204. Ou
The most frequently asked question in the PHP email list is: how to install PHP on my Windows machine ?, Maybe I can help answer this question. After the installation is complete, you will find that developing PHP programs in Windows is still good. The purpose of this tutorial is to show you how to use a combination of Apache
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.