~lifeless/python-oops-tools/bug-881400

« back to all changes in this revision

Viewing changes to src/oopstools/README.txt

  • Committer: Robert Collins
  • Date: 2011-10-13 20:18:51 UTC
  • Revision ID: robertc@robertcollins.net-20111013201851-ym8jmdhoeol3p83s
Export of cruft-deleted tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
..
 
2
    This file is part of oopstools
 
3
 
 
4
    Copyright 2009-2011 Canonical Ltd.  All rights reserved.
 
5
 
 
6
    This program is free software: you can redistribute it and/or modify
 
7
    it under the terms of the GNU Affero General Public License as published by
 
8
    the Free Software Foundation, either version 3 of the License, or
 
9
    (at your option) any later version.
 
10
 
 
11
    This program is distributed in the hope that it will be useful,
 
12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
    GNU Affero General Public License for more details.
 
15
 
 
16
    You should have received a copy of the GNU Affero General Public License
 
17
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 
 
19
OOPS Tools
 
20
==========
 
21
 
 
22
This is a Django application to analyze OOPS reports
 
23
(see https://launchpad.net/python-oops).
 
24
 
 
25
Please see https://dev.launchpad.net/LazrStyleGuide and
 
26
https://dev.launchpad.net/Hacking for how to develop in this
 
27
package.
 
28
 
 
29
Dependencies
 
30
============
 
31
 
 
32
OOPStools uses buildout for configuration.
 
33
 
 
34
All dependencies (except for the database packages) are available from the
 
35
lazr-source-dependencies branch on Launchpad. Simply typing make will set-up
 
36
the download-cache of dependencies eggs and then create the buildout.
 
37
 
 
38
If you already have that shared eggs cache branch available locally (to share
 
39
between branches of the Lazr project), simply set the LAZR_SOURCEDEPS_DIR to
 
40
the directory containing the download-cache and eggs directories before
 
41
invoking make.
 
42
 
 
43
To run under apache with mod_wsgi (recommended)
 
44
 
 
45
    * libapache2-mod-wsgi package
 
46
 
 
47
To run under apache with mod_python
 
48
 
 
49
    * libapache2-mod-python package
 
50
 
 
51
Deployment using mod_wsgi
 
52
=========================
 
53
 
 
54
Update the production.cfg file with your database configuration and the paths
 
55
to your OOPS directories:
 
56
 
 
57
[configuration]
 
58
db-name = /path/to/your/oops.db
 
59
index-template = 'index.html'
 
60
oopsdir = /path/to/oops/reports
 
61
 
 
62
Update settings.py setting a custom SECRET_KEY
 
63
 
 
64
To deploy oops tools make sure all the dependecies are installed.
 
65
 
 
66
 * bin/buildout -c production.cfg
 
67
 
 
68
 * Run bin/django syncdb
 
69
 
 
70
 * Run bin/django migrate
 
71
 
 
72
 * Copy apache/oops-tools.dev.mod_wsgi to /etc/apache2/sites-available/
 
73
 
 
74
Running locally
 
75
===============
 
76
 
 
77
Sometimes Launchpad developers want to run oops-tools to help analyse locally
 
78
generated OOPS reports.
 
79
 
 
80
The first step is to setup the local database.
 
81
 
 
82
Local PostgreSQL setup
 
83
++++++++++++++++++++++
 
84
 
 
85
If you do Launchpad development, you probably have PostgreSQL already running
 
86
on port 5432. You'll need another cluster to run the oops-tools database.
 
87
 
 
88
Create a new cluster for lpoops:
 
89
 
 
90
    $ LC_ALL=C sudo pg_createcluster 8.4 lpoops --encoding UNICODE --port 5433
 
91
 
 
92
Apply the following patch to /etc/postgresql/8.4/lpoops/pg_hba.conf. Note that
 
93
this configuration change needs to be before the "DO NOT DISABLE!" line in the
 
94
pg_hba.conf file.
 
95
 
 
96
    sudo patch /etc/postgresql/8.4/lpoops/pg_hba.conf <<'EOF'
 
97
    --- pg_hba.conf 2005-11-02 17:33:08.000000000 -0800
 
98
    +++ /tmp/pg_hba.conf    2005-11-03 07:32:46.932400423 -0800
 
99
    @@ -58,7 +58,9 @@
 
100
     # on a non-local interface via the listen_addresses configuration parameter,
 
101
     # or via the -i or -h command line switches.
 
102
     #
 
103
    -
 
104
    +# Oops-tools users
 
105
    +local   all         all                           trust
 
106
    +host    all         all         127.0.0.1/32      trust
 
107
 
 
108
 
 
109
    EOF
 
110
 
 
111
In case localhost is using IPv6, you'll need an extra line just below the one above.
 
112
 
 
113
    host    all         all         ::1/128               trust
 
114
 
 
115
Start the cluster.
 
116
 
 
117
    $ sudo pg_ctlcluster 8.4 lpoops start
 
118
 
 
119
Add your own user to the cluster:
 
120
 
 
121
    $ sudo -u postgres /usr/lib/postgresql/8.4/bin/createuser -a -d $USER --port
 
122
    5433
 
123
 
 
124
To create the new db:
 
125
 
 
126
    $ createuser lpoops --createdb --no-superuser --no-createrole --port 5433
 
127
    $ createdb -O lpoops lpoops --host localhost --port 5433
 
128
 
 
129
Note that this command creates a password-less database. Use --password to
 
130
create a db with a password.
 
131
 
 
132
To delete the db:
 
133
 
 
134
    $ dropdb lpoops --port 5433
 
135
    $ dropuser lpoops --port 5433
 
136
 
 
137
Configuration changes
 
138
+++++++++++++++++++++
 
139
 
 
140
If you used a different port than 5433 for the PostgreSQL setup, pass the
 
141
DBPORT variable to make and it'll build the configuration files using the
 
142
value provided.
 
143
 
 
144
 * `make DBPORT=$PORT`
 
145
 * Run bin/django syncdb
 
146
 * Run bin/django migrate
 
147
 * `make run` at the root of the oops-tools directory
 
148
 * Point your browser to http://localhost:8000/oops