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

How to use Awstats log analysis

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article will explain in detail how to use Awstats log analysis. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

AWStats log analysis system

An open source log analysis system developed by PerI language

It can be used to analyze the access logs of Apache, Samba, Vsftpd, IIS and other servers.

Combined with crond and other scheduled task services, the log content can be analyzed regularly.

Install and configure Apache and DNS services

[root@localhost ~] # yum install bind httpd-y

Modify the DNS main configuration file

[root@localhost ~] # vim / etc/named.conf / / enter the DNS main configuration file

Options {

Listen-on port 53 {any;}; / / listen locally for all

Listen-on-v6 port 53 {:: 1;}

Directory "/ var/named"

Dump-file "/ var/named/data/cache_dump.db"

Statistics-file "/ var/named/data/named_stats.txt"

Memstatistics-file "/ var/named/data/named_mem_stats.txt"

Recursing-file "/ var/named/data/named.recursing"

Secroots-file "/ var/named/data/named.secroots"

Allow-query {any;}; / / allow all

Modify the zone profile

[root@localhost ~] # vim / etc/named.rfc1912.zones modify zone configuration file

Zone "localhost" IN {/ / copy a template

Type master

File "named.localhost"

Allow-update {none;}

}

Zone "kgc.com" IN {/ / modify localhost to kgc.com

Type master

File "kgc.com.zone"; / / write the name of the zone data profile

Allow-update {none;}

}

Modify the zone data profile

[root@localhost ~] # cd / var/named/

[root@localhost named] # cp-p named.localhost kgc.com.zone

/ / copy a template as a regional data configuration file

[root@localhost named] # vim kgc.com.zone

$TTL 1D

@ IN SOA @ rname.invalid. (

0; serial

1D; refresh

1H; retry

1W; expire

3H); minimum

NS @

A 127.0.0.1

Www IN A 192.168.131.129 / / add a domain name resolution address as a local address

[root@localhost named] # systemctl start named

Modify the http main configuration file

[root@localhost html] # vim / etc/httpd/conf/httpd.conf / / enter the httpd configuration file

Listen 192.168.131.129 IP 80 / / modify the ipv4 listening address to native IP

# Listen 80 / / annotate ipv6 port

ServerName www.kgc.com:80 / / modify domain name

[root@localhost named] # systemctl stop firewalld.service / / turn off the firewall

[root@localhost named] # setenforce 0 / / turn off enhanced security features

[root@localhost html] # systemctl start httpd.service / / start the httpd service

Visit the test website with the test machine (dns service address 192.168.131.129)

At this point, go to the server to view the log file, and you can see which hosts have visited our website.

Remotely mount and install the Awstats toolkit

[root@localhost aaa] # mkdir / aaa / / create a local mount directory

[root@localhost ~] # mount.cifs / / 192.168.100.3/LAMP / aaa / / remotely mount files to local

Password for root@//192.168.10.37/LAMP:

[root@localhost aaa] # cd / aaa / / enter mount point / aaa

[root@localhost aaa] # tar zxvf awstats-7.6.tar.gz-C / opt/ extract the awstats toolkit to the local / opt directory

[root@localhost aaa] # ls / opt

Awstats-7.6 rh

[root@localhost aaa] # cd / opt

[root@localhost opt] # mv awstats-7.6/ / usr/local/awstat

/ / move the awstats toolkit to / usr/local/awsta

[root@localhost opt] # ls / usr/local/ check whether there is an awstat file in the directory

Awstat etc include lib64 sbin src

Bin games lib libexec share

[root@localhost opt] # ls/ usr/local/awstat/tools/ check whether there are awstats_configure.pl files in this directory

Awstats_buildstaticpages.pl logresolvemerge.pl

Awstats_configure.pl maillogconvert.pl

Awstats_exportlib.pl nginx

Awstats_updateall.pl urlaliasbuilder.pl

Dolibarr webmin

Geoip_generator.pl xslt

Httpd_conf

[root@localhost opt] # cd / usr/local/awstat/tools/ enter the directory

[root@localhost tools] #. / awstats_configure.pl / / start configuration file

Enter full config file path of your Web server.

Example: / etc/httpd/httpd.conf

Example: / usr/local/apache2/conf/httpd.conf

Example: C:\ Program files\ apache group\ apache\ conf\ httpd.conf

Config file path ('none' to skip web server setup):

/ etc/httpd/conf/httpd.conf

/ / fill in the configuration file path

Do you want me to build a new AWStats config/profile

File (required if first install) [yplink N]? Y / / confirm to create a new profile

What is the name of your web site or profile analysis?

Example: www.mysite.com

Example: demo

Your web site, virtual server or profile name:

Www.kgc.com / / enter the domain name of the website

In which directory do you plan to store your config file (s)?

Default: / etc/awstats

Directory path to store config file (s) (Enter for default):

/ / the configuration file directory corresponding to the default domain name of enter

Http://localhost/awstats/awstats.pl?config=www.kgc.com

/ / this page is the URL we want to visit.

Press ENTER to finish..

Modify Apache configuration file

[root@localhost tools] # vim / etc/httpd/conf/httpd.conf

...

three hundred and sixty six

367 Options None

368 AllowOverride None

369 Order allow,deny

370 Allow from all

371 Require all granted / / insert this line entry on this line to allow all access

three hundred and seventy two

Modify awstats configuration file

[root@localhost tools] # ls / etc/awstats/

Awstats.www.kgc.com.conf

[root@localhost tools] # vim / etc/awstats/awstats.www.kgc.com.conf

LogFile= "/ var/log/httpd/access_log"

Use / LogFile to find the line of the keyword and change the end to access_log

Create a folder for awstats and restart the service

[root@localhost tools] # cd / var/lib/

[root@localhost lib] # mkdir awstats

[root@localhost lib] # systemctl stop httpd

[root@localhost lib] # systemctl start httpd

Optimize the website address and use the client to access it

[root@localhost tools] # cd / var/www/html/ enter the site directory

[root@localhost html] # vim aws.html / / create an aws.html web page and put the original battle page link into it.

[root@localhost html] # ls

Aws.html

At this point, we only need to visit www.kgc.com/AWS.html on the test machine to access the statistics page.

This is the end of this article on "how to use Awstats log analysis". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

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