Repository navigation
Expand file tree
/
Copy pathINSTALL
More file actions
128 lines (76 loc) · 3.01 KB
/
Copy pathINSTALL
File metadata and controls
128 lines (76 loc) · 3.01 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
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
Clone the Onionoo server repository
-----------------------------------
Create working directory /srv/onionoo/, make it writable for the metrics
user, and clone the Onionoo server repository into it. Commands prefixed
with # are meant to be run by root, commands with $ by user metrics:
# mkdir /srv/onionoo
# chown metrics:metrics /srv/onionoo
$ git clone https://git.torproject.org/onionoo.git /srv/onionoo/
$ cd /srv/onionoo
Install Java 1.7 or higher and ant 1.8 or higher
------------------------------------------------
$ javac -version
javac 1.7.0_65
$ ant -version
Apache Ant version 1.8.0 compiled on March 11 2010
Provide required .jar files
---------------------------
Download .jar files listed in the build.xml classpath. Onionoo usually
uses Debian stable provided libraries; see vagrant/bootstrap.sh for Debian
package names. If you download .jar files elsewhere, please edit the
corresponding paths in build.xml.
Attempt to compile the Java sources to make sure that everything works
correctly:
$ ant compile
Download GeoIP and ASN database files
-------------------------------------
Onionoo uses an IP-to-city database and an IP-to-ASN database to provide
additional information about a relay's location.
First, create the geoip/ directory and change to it:
$ mkdir -p geoip
$ cd geoip/
Download the most recent MaxMind GeoLite2 City database and unzip it in
the current directory, junking paths:
$ wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-City-CSV.zip
$ unzip -j GeoLite2-City-CSV.zip
Download the most recent MaxMind GeoLite ASN database file and unzip it in
the current directory:
$ wget https://www.maxmind.com/download/geoip/database/asnum/GeoIPASNum2.zip
$ unzip GeoIPASNum2.zip
Change back to the root working directory:
$ cd ../
Test the hourly data processing process
---------------------------------------
Run the data processing process that will afterwards be run once per hour.
Create a .jar file:
$ ant jar
The initial run may take a while:
$ java -DLOGBASE=/path/to/logfiles -Xmx4g -jar dist/onionoo-<version>.jar
Set up an hourly cronjob
------------------------
Add a crontab line similar to the command above:
15 * * * * cd /srv/onionoo/ && java -DLOGBASE=/path/to/logfiles \
-Xmx4g -jar dist/onionoo-<version>.jar
Run the web server
------------------
Create a .war file:
$ ant war
Start the Onionoo server
$ java -DLOGBASE=/path/to/logfiles -Xmx4g -jar dist/onionoo-<version>.war
The Onionoo server should now be available at
http://localhost:8080/.
Configure Embedded Jetty
------------------------
Settings for the embedded jetty can be found in etc/jetty.xml
If you change anything, run
$ ant clean war
again.
Configure logging
-----------------
Logging can be configured inside etc/logback.xml
If you change anything, run
$ ant clean war jar
again.
The command line option LOGBASE is the path for the log files.
In case you forget to set it, you'll find the logs in the current
path in the folder LOGBASE_IS_UNDEFINED/