forked from darold/squidanalyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
167 lines (129 loc) · 6.65 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
NAME
SquidAnalyzer - Squid access log report generation tool
REQUIREMENT
Nothing is required than a modern perl version 5.8 or higher. Graphics
are based on the Flotr2 Javascript library so they are drawn at your
browser side without extra installation required.
INSTALLATION
Generic install
If you want the package to be intalled into the Perl distribution just
do the following:
perl Makefile.PL
make
make install
Follow the instruction given at the end of install. With this default
install everything configurable will be installed under
/etc/squidanalyzer. The Perl library SquidAnalyzer.pm will be installed
under your site_perl directory and the squid-analyzer Perl script will
be copied under /usr/local/bin.
The default output directory for html reports will be
/var/www/squidanalyzer/.
On FreeBSD, if make install is freezing and you have the following
messages:
FreeBSD: Registering installation in the package database
FreeBSD: Cannot determine short module description
FreeBSD: Cannot determine module description
please proceed as follow:
perl Makefile.PL INSTALLDIRS=site
make
make install
as the issue is related to an install into the default Perl vendor
installdirs it will then use Perl site installdirs.
Custom install
You can create your fully customized SquidAnalyzer installation by using
the Makefile.PL Perl script. Here is a sample:
perl Makefile.PL \
LOGFILE=/var/log/squid3/access.log \
BINDIR=/usr/bin \
CONFDIR=/etc \
HTMLDIR=/var/www/squidreport \
BASEURL=/squidreport \
MANDIR=/usr/man/man3 \
DOCDIR=/usr/share/doc/squidanalyzer
If you want to build a distro package, there are two other options that
you may use. The QUIET option is to tell to Makefile.PL to not show the
default post install README. The DESTDIR is to create and install all
files in a package build base directory. For example for Fedora RPM,
thing may look like that:
# Make Perl and SendmailAnalyzer distrib files
%{__perl} Makefile.PL \
INSTALLDIRS=vendor \
QUIET=1 \
LOGFILE=/var/log/squid/access.log \
BINDIR=%{_bindir} \
CONFDIR=%{_sysconfdir} \
BASEDIR=%{_localstatedir}/lib/%{uname} \
HTMLDIR=%{webdir} \
MANDIR=%{_mandir}/man3 \
DOCDIR=%{_docdir}/%{uname}-%{version} \
DESTDIR=%{buildroot} < /dev/null
See spec file in packaging/RPM for full RPM build script.
Local install
You can also have a custom installation. Just copy the SquidAnalyzer.pm
and the squid-analyzer perl script into a directory, copy and modify the
configuration file and run the script from here with the -c option.
Then copy files sorttable.js, squidanalyzer.css and
logo-squidanalyzer.png into the output directory.
Post installation
1. Modify your httpd.conf to allow access to HTML output like follow:
Alias /squidreport /var/www/squidanalyzer
<Directory /var/www/squidanalyzer>
Options -Indexes FollowSymLinks MultiViews
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Directory>
2. If necessary, give additional host access to SquidAnalyzer in
httpd.conf. Restart and ensure that httpd is running.
3. Browse to http://my.host.dom/squidreport/ to ensure that things are
working properly.
4. Setup a cronjob to run squid-analyzer daily or more often:
# SquidAnalyzer log reporting daily
0 2 * * * /usr/local/bin/squid-analyzer > /dev/null 2>&1
or run it manually. For more information, see README file.
You can use network name instead of network ip addresses by using the
network-aliases file. Also if you don't have authentication enable and
want to replace client ip addresses by some know user or computer you
can use the user-aliases file to do so.
See the file squidanalyzer.conf to customized your output statistics and
match your network and file system configuration.
USAGE
SquidAnalyzer can be run manually or by cron job using the
squid-analyzer Perl script. Here are authorized usage:
Usage: squid-analyzer [ -c squidanalyzer.conf ] [-l logfile]
-c | --configfile filename : path to the SquidAnalyzer configuration file.
By default: /etc/squidanalyzer.conf
-b | --build_date date : set the day to be rebuilt, format: yyyy-mm-dd,
yyyy-mm or yyyy. Used with -r or --rebuild.
-d | --debug : show debug informations.
-h | --help : show this message and exit.
-l | --logfile filename : path to the Squid logfile to parse.
By default: /var/log/squid/access.log
-p | --preserve number : used to set the statistic obsolescence in
number of month. Older stats will be removed.
-r | --rebuild : use this option to rebuild all html and graphs
output from all data files.
-v | version : show version and exit.
--no-year-stat : disable years statistics, reports will
start from month level only.
There is special options like --rebuild that force SquidAnalyzer to
rebuild all HTML reports, useful after an new feature or a bug fix. If
you want to limit the rebuild to a single day, a single month or year,
you can use the --build_date option by specifying the date part to
rebuild, format: yyyy-mm-dd, yyyy-mm or yyyy.
The --preserve option should be used if you want to rotate your
statistics and data. The value is the number of months to keep, older
reports and data will be removed from the filesystem. Useful to preserve
space, for example:
squid-analyzer -p 6 -c /etc/squidanalyzer/squidanalyzer.conf
will only preserve six month of statistics from the last run of
squidanalyzer.
CONFIGURATION
See README file.
AUTHOR
Gilles DAROLD <[email protected]>
COPYRIGHT
Copyright (c) 2001-2015 Gilles DAROLD
This package is free software and published under the GPL v3 or above
license.