forked from clearcode/Apache2Piwik
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
96 lines (75 loc) · 2.94 KB
/
Copy pathREADME
File metadata and controls
96 lines (75 loc) · 2.94 KB
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
Apache2Piwik Exporter, version 1.0, June 2011
This software is released under GPL v3 license:
http://www.gnu.org/licenses/gpl-3.0.html
Description
===========
Apache2Piwik is a script written in Python to enable exporting
statistics from Apache logs to Piwik.
Requirements
============
- Access to Piwik 1.4 or 1.5 Installation.
- Access to Apache logs with read rights.
- Python 2.6 with components:
- MySQLdb
- pygeoip (http://code.google.com/p/pygeoip)
- httpagentparser (http://pypi.python.org/pypi/httpagentparser/0.8.2)
- PyQt4 (http://www.riverbankcomputing.co.uk/software/pyqt/download) --gui version only
Preparation
===========
Before running the script please be sure to:
- Prepare `settings.py` configuration file - sample in settings.py.sample
- Create backup of your Piwik MySQL Database
Running
=======
$ cd apache2piwik
$ python apache2piwik.py
Running with options
====================
You can override ID_SITE, APACHE_LOG_FILES, CHRONOLOGICAL_ORDER, CONTINUE from settings.py
Examples:
$ python apache2piwik.py -c0 -b0 -f "log1.txt;log2.txt" -i3
$ python apache2piwik.py -c0 -b1 -f "log1.txt" -i3
Usage: apache2piwik.py [start|stop] [OPTIONS]
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-f FILES, --file=FILES apache log files, files names should be ;-seperated, (overrides APACHE_LOG_FILES)
-b {0 or 1} --chronological_order={0 or 1} if files are chronologicaly orderd, (overrides CHRONOLOGICAL_ORDER)
-c {0 or 1} --continue={0 or 1} if you want to run script more than one time on one set of data (overrides CONTINUE)
-i INT, --id_site=INT Piwik id site (overrides ID_SITE)
-r, --remove_cache Remove cache files
-g, --goal Create data for goals
Goals
=====
If you add new goals after data are in database, run
$ python apache2piwik.py -g
to update the goals data in database.
Remember to delete piwik_archive_blob and piwik_archive_numeric tables before viewing result in piwik.
Running daemon
==============
First set LIFE variable in settings to True and FREQUENCY_OF_READING as you wish.
To start a daemon on log file run
$ python apache2piwik.py start
and to stop
$ python apache2piwik.py stop
Running GUI
===========
$ cd Apache2Piwik
$ python apache2piwikgui.py
Building binaries
=================
- Make sure you have all the requirements, including PyQt4
- Get pyinstaller (http://www.pyinstaller.org/)
- Run:
$ python /path/to/pyinstaller/Configure.py
$ python /path/to/pyinstaller/Makespec.py --onefile Apache2Piwik/apache2piwikgui.py
$ python /path/to/pyinstaller/Build.py apache2piwikgui.spec
- Copy Apache2Piwik/lib/* to dist/lib/*
Contact
=======
Copyright (C) 2011 by Clearcode (http://clearcode.cc)
Development Team:
Małgorzata Jurkiewicz
Maciej Zawadziński
Piotr Rzepecki
Contact: office@clearcode.cc