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

Apache---AWStats log analysis

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

AWStats log analysis system

An open source log analysis system developed by 1.PerI language

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

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

Deploy AWStats log analysis system

AWStats toolkit sharing links (no password)

Https://pan.baidu.com/s/1hhYmwIBdvqwVHZHcaB4dMQ

Step 1: install and configure Apache and DNS services

1. Installation service

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

two。 Configure the DNS master profile

[root@localhost ~] # vim / etc/named.conf options {listen-on port 53 {any;}; / / replace 127.0.0.1 with any. / / omit part of the content allow-query {any;}; / / replace ocalhost with any

3. Configure the DNS zone profile

[root@localhost ~] # vim / etc/named.rfc1912.zoneszone "bdqn.com" IN {type master; file "bdqn.com.zone"; allow-update {none;};}

4. Configure the DNS zone data profile and start the service

[root@localhost ~] # cd / var/named/ [root@localhost named] # cp-p named.localhost bdqn.com.zone [root@localhost named] # vim bdqn.com.zone $TTL 1D @ IN SOA @ rname.invalid. (0; serial 1D; refresh 1H; retry 1W; expire 3H) Minimum NS @ A 127.0.0.1www IN A 192.168.235.149 Universe A record address is the native IP address [root@localhost named] # systemctl start named

5. Modify the Apache service master profile and start the service

[root@localhost ~] # vim / etc/httpd/conf/httpd.conf... 41 Listen 192.168.235.149 IPV6 80 / / add listening address to local host IP address 42 # Listen 80 / comment out line 46 IPV6 listening on line 41 of the file. 95 ServerName www.bdqn.com:80 / / modify the domain name address [root@localhost ~] # systemctl stop firewalld.service [root@localhost ~] # setenforce 0 [root@localhost ~] # systemctl start httpd on line 95

6. Testing with a win7 client

Step 2: share and install the Awstar toolkit [root@localhost aaa] # mkdir / aaa [root@localhost ~] # mount.cifs / / 192.168.10.37/LAMP / aaaPassword for root@//192.168.10.37/LAMP: / / remotely mount the shared package on the Windows host [root@localhost aaa] # cd / aaa [root@localhost aaa] # tar zxvf awstats-7.6.tar.gz-C / opt/// to / Opt directory [root@localhost aaa] # ls / optawstats-7.6 rh [root@localhost aaa] # cd / opt [root@localhost opt] # mv awstats-7.6/ / usr/local/awstat// Mobile Toolkit to [root@localhost opt] # ls / usr/local/ check if there is an awstat file awstat etc include lib64 sbin srcbin games lib libexec share [root@localhost opt] # ls / usr/local/awstat/tools in the command / / check whether there is an awstats_configure.pl file in this command, awstats_buildstaticpages.pl logresolvemerge.plawstats_configure.pl maillogconvert.plawstats_exportlib.pl nginxawstats_updateall.pl urlaliasbuilder.pldolibarr webmingeoip_generator.pl xslthttpd_ confession [root @ localhost opt] # cd / usr/local/awstat/tools/ enter the directory [root@localhost tools] # . / awstats_configure.pl// runs the file. Do you want to continue setup from this NON standard directory [yN]? Config file path / enter y to confirm at this step... Config file path ('none' to skip web server setup): > / etc/httpd/conf/httpd.conf// enter the path to the Apache service at this step, Do you want me to build a new AWStats config/profilefile (required if first install) [y Do you want me to build a new AWStats config/profilefile N]? Enter y Your web site / this step enter y to confirm. Your web site, virtual server or profile name: > enter the domain name of the website in this step. / / press enter key in the following steps. Step 3: modify the Apache configuration file [root@localhost tools] # vim / etc/httpd/conf/httpd.conf. 366 367 Options None368 AllowOverride None369 Order allow Deny370 Allow from all371 Require all granted / / insert this line entry at line 371 to allow all access to 372 step 4: modify the created awstart file [root@localhost tools] # ls / etc/awstats/awstats.www.bdqn.com.conf [root@localhost tools] # vim / etc/awstats/awstats.www.bdqn.com.conf 50 LogFile= "/ var/log/httpd/access_log" / / modify line 50 The end content is access_log step 5: create an awstats folder 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 step 6: test with the client

Enter http://www.bdqn.com/awstats/awstats.pl?config=www.bdqn.com in the browser

You can access the statistics page of the log analysis system

However, the address of this website is too complicated, so we can optimize it.

[root@localhost tools] # cd / var/www/html/ enter the site directory [root@localhost html] # vim aws.html / / to create an aws.html page, and put the original battle page link into [root@localhost html] # lsaws.html

In this way, we only need to visit www.bdqn.com/AWS.html to associate access to the statistics page.

The above is the whole content of the log analysis, thank you for reading!

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