10 minutes analysis web server

  
                              

After setting up a web server, the most concerned about the use of the system. This requires us to analyze the log files. A well-known day analysis tool is called "analog". This article will let the reader quickly construct its own analysis program through the configuration of the analog.

Because the time is only ten minutes, we won't talk about the configuration options of Analog. Here's a simple example:

DNS WRITE
DNSFILE /tmp/dnsfile.txt
HOSTNAME "FreeLAMP"
HOSTEXCLUDE mordell.ex.ac.uk
OUTFILE /home /albert/public_html/outputfile.html

The first two lines are used to improve the host name search speed, HOSTNAME is used to generate the title of the report, HOSTEXCLUDE ignores those hosts we are not interested in, and OUTFILE is the report write. file.

Next, you can view our report, what? Does the picture look problematic? That is the problem with the path of the image, very simple, modify httpd.conf, add:

Alias ​​/doc/analog/images//usr/doc/analog/images/
Restart Apache, should Yes.

The next step is to make the program run every day, very simple, use:
# crontab -e

command to add a line:
0 3 * * * /usr/bin /analog +g/home/albert/analog.ini

Ok, ten minutes is over. what? Only five minutes? Congratulations, you are so great, Linux is simply a good way for you! Maybe you can still look down.

If you want to know which sites bring you traffic, you need to change the logging format in httpd.conf. Another trick is the -settings option, which will output the current configuration. Also, after using DNS WRITE and DNSFILE, the analog can process more than 1MB of logs in one second.

A more complicated example:

MONTHLY OFF
WEEKLY OFF
DAILY OFF
REFREPEXCLUDE http://www.freelamp.com/*
FILEEXCLUDE /ads /*
DNS WRITE
DNSFILE /tmp/dnsfile.txt
HOSTNAME "FreeLAMP"
DOMAINSFILE /root/alli
REFSITE ON
DOMAIN ON
REFERRER ON

There are also options such as MONTHLY OFF, WEEKLY OFF, and DAILY OFF. Of course, you can set it yourself.

Copyright © Windows knowledge All Rights Reserved