Squid log analysis
Configure log analysis: yum install httpd gd-y / install http and GD libraries and pull the sarg package into tar xf sarg-2.3.11.tar.gz-C / opt/ unzipped log analysis package cd / opt/sarg-2.3.11/ define it in the unzipped folder. / configure\-- prefix=/usr/local/sarg\ / / specify the installation path- -sysconfdir=/etc/sarg\ / / configuration file directory The default is / usr/local/etc--enable-extraprotection / / to add additional security make & & make install
Vi / etc/sarg/sarg.conf / / configuration
Search and modify the content:
Access log location of access_log / usr/local/squid/var/logs/access.log / / squid
Title "Squid User Access Reports" / / Page title
Location of output_dir / var/www/html/squid-reports / / Analysis report
User_ip no / / do not use IP instead of user ID
Topuser_sort_field BYTES reverse / / ascending order
User_sort_field BYTES reverse / / in top sorting, specify the number of connections and the number of bytes accessed, and replace reverse with normal in descending and ascending order
Exclude_hosts / usr/local/sarg/noreport / / sets the host that does not generate reports
Overwrite_report no / / when that date report already exists and is not overwritten
Mail_utility mailx / / specify the command to send mail
Charset UTF-8 / / use character set
Weekdays 0-6 / / specify the week cycle of top sort
Hours 7-12, 14, 16, 18-20 / / specify the top sorting time period
Www_document_root / var/www/html / / Web page root directory
Touch / usr/local/sarg/noreport / / create a host list file ls that does not generate reports
Ln-s / usr/local/sarg/bin/sarg / usr/local/bin/ establish a soft connection to facilitate the environment variable PATH to identify sarg/ / direct input
As shown in the figure, it indicates that systemctl start httpd is running normally and enter http://192.168.80.100/squid-reports/ in the windows browser.