forked from ccpgames/eve-metrics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHowToSetupEveMetrics.txt
executable file
·142 lines (92 loc) · 4.89 KB
/
HowToSetupEveMetrics.txt
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
***********************
* EVE METRICS (c) CCP *
***********************
------------
PYTHON SETUP
------------
Python with pyodbc and python-ldap needs to be setup
1. Install Python 2.7.9
2. Open command line window in folder \Python27 and execute the following to install pyodbc and python-ldap...
Scripts\pip install pyodbc
Scripts\pip install python-ldap
----------------
SQL SERVER SETUP
----------------
SQL Server needs to be setup
-------------
EXTRACT FILES
-------------
Unzip ebs_METRICS.zip file to folder ebs_METRICS
----------------------------------------
EVE METRICS DATABASE SETUP IN SQL SERVER
----------------------------------------
Create database ebs_METRICS
Create login ebs_METRICS using SQL Server authentication with password ebs_METRICS and connect it to database ebs_METRICS as db_owner
Open the following files in SQL Studio and execute on database ebs_METRICS...
coreUpdateJ_ALL_FOR_NEW_DB.sql
metricsUpdate_ALL_FOR_NEW_DB.sql
metricsTestData.sql
-----------------
DB CONNECTION STRINGS
-----------------
The DB connection strings for the WEB2PY DAL on one hand and direct pyodbc on the other are set up at the top of the following file:
web2py/applications/evemetrics/models/db.py
If you are running on Windows you will typically only need to change the DB_SERVER value. Typically when testing this will just be "LOCALHOST"
-----------------
RUN WEB2PY SERVER
-----------------
Open command line window in folder ebs_METRICS/web2py and execute...
\Python27\python web2py.py -i 127.0.0.1 -p 80 -a changeme
Then you have access to EVE Metrics on http://127.0.0.1/evemetrics/default
If port 80 is already in use you can use another port for testing.
-----------------
EVE METRICS ON UBUNTU
-----------------
The setup instructions above assume a Windows platform. If you want to run Eve Metrics on Linux you will need to take an additonal step to get things up and running.
This step involves setting up MS SQL Server ODBC connection from Linux. Note that the MS SQL Instance only runs on Windows while the webserver can run on Linux. This will take some fiddling around with on your part so set aside a couple of hours.
We will assume an Ubuntu Linux instance running in AWS with the ebs_METRICS database running on a managed RDS instance.
I followed these instructions: http://onefinepub.com/2013/03/ms-sql-odbc-ubuntu/
Here are the microft instructions:
https://msdn.microsoft.com/en-us/library/hh568454(v=sql.110).aspx
Here is the download link to the driver:
https://www.microsoft.com/en-us/download/details.aspx?id=36437
You will need to set up the DB objects using SQL Server Manager studio (free download from MS) running on Windows so I would highly recommend a Windows dev environment.
Once you have followed the tutorial above and after the database is ready with the objects created and the proper permission for the user you can test if everything is okay from the Linux side by running the following:
ubutnu@ip-10-50-1-1:~/web2py$ sqlcmd -S myserver-mssql.c40zji49p9dj.eu-west-1.rds.amazonaws.com -U ebs_METRICS
Password: ebs_Metrics
1> USE ebs_METRICS
2> GO
Changed database context...
1> SELECT * FROM zmetric.countersEx
2> GO
You should now receive a wall of text from that view and are good to go.
When setting up the connection in the web2py config you will need to use the following driver:
DB_DRIVER = "{freetds}"
This assumes the following entry in /etc/odbcinst.ini:
[freetds]
...
And the following entry in /etc/odbc.ini
[mssql]
...
Driver = freetds
...
These entries were added during the driver installation and perhaps through some liberal copy/paste. You might need to tweak your config accordingly.
If you run into issues I would suggest getting the connection to work in a python shell using pyodbc before running the web2py stack.
> pyodbc.connect("DRIVER={freetds};SERVER=myserver-mssql.c40zji49p9dj.eu-west-1.rds.amazonaws.com;DATABASE=ebs_METRICS;UID=ebs_METRICS;PWD=ebs_METRICS")
> curr = pyodbc.execute("SELECT * FROM zmetric.countersEx")
> print curr.fetchone()
NOTE: The Linux unixODBC driver does not line nvarchar(max) fields so I needed to change them to nvarchar(4000) in my local repo
If you get a locale error when viewing the website you will need to install the en_GB locale.
http://askubuntu.com/questions/76013/how-do-i-add-locale-to-ubuntu-server
> sudo locale-gen en_GB
> sudo locale-gen en_GB.UTF-8
> sudo dpkg-reconfigure locales
To install ldap you need to do the following:
> sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
> sudo pip install python-ldap
http://stackoverflow.com/questions/4768446/python-cant-install-python-ldap
Installing phantomJS on Ubuntu: https://gist.github.com/julionc/7476620
-----------
OTHER STUFF
-----------
Password for Admin tab is changeme