2
This file is part of oopstools
4
Copyright 2009-2011 Canonical Ltd. All rights reserved.
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.
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.
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/>.
22
This is a Django application to analyze OOPS reports
23
(see https://launchpad.net/python-oops).
25
Please see https://dev.launchpad.net/LazrStyleGuide and
26
https://dev.launchpad.net/Hacking for how to develop in this
32
OOPStools uses buildout for configuration.
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.
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
43
To run under apache with mod_wsgi (recommended)
45
* libapache2-mod-wsgi package
47
To run under apache with mod_python
49
* libapache2-mod-python package
51
Deployment using mod_wsgi
52
=========================
54
Update the production.cfg file with your database configuration and the paths
55
to your OOPS directories:
58
db-name = /path/to/your/oops.db
59
index-template = 'index.html'
60
oopsdir = /path/to/oops/reports
62
Update settings.py setting a custom SECRET_KEY
64
To deploy oops tools make sure all the dependecies are installed.
66
* bin/buildout -c production.cfg
68
* Run bin/django syncdb
70
* Run bin/django migrate
72
* Copy apache/oops-tools.dev.mod_wsgi to /etc/apache2/sites-available/
77
Sometimes Launchpad developers want to run oops-tools to help analyse locally
78
generated OOPS reports.
80
The first step is to setup the local database.
82
Local PostgreSQL setup
83
++++++++++++++++++++++
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.
88
Create a new cluster for lpoops:
90
$ LC_ALL=C sudo pg_createcluster 8.4 lpoops --encoding UNICODE --port 5433
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
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
100
# on a non-local interface via the listen_addresses configuration parameter,
101
# or via the -i or -h command line switches.
106
+host all all 127.0.0.1/32 trust
111
In case localhost is using IPv6, you'll need an extra line just below the one above.
113
host all all ::1/128 trust
117
$ sudo pg_ctlcluster 8.4 lpoops start
119
Add your own user to the cluster:
121
$ sudo -u postgres /usr/lib/postgresql/8.4/bin/createuser -a -d $USER --port
124
To create the new db:
126
$ createuser lpoops --createdb --no-superuser --no-createrole --port 5433
127
$ createdb -O lpoops lpoops --host localhost --port 5433
129
Note that this command creates a password-less database. Use --password to
130
create a db with a password.
134
$ dropdb lpoops --port 5433
135
$ dropuser lpoops --port 5433
137
Configuration changes
138
+++++++++++++++++++++
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
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