avoid further update conflicts
[mygpo.git] / INSTALL
blob0aaab04cbca0c4e6175f127ac31cc54a179f9190
3                    Deployment instructions for mygpo
4                    ---------------------------------
7 Please note that this deployment instructions apply to the current couchdb
8 branch of mygpo/gpodder.net only. They will change once the migration to
9 CouchDB has been completed.
12   Dependencies
13 ================
15 When no version number is indicated, it is advisable to install the current
16 development version from the repository.
18   * Python (>= 2.6)
19   * CouchDB (>= 1.1)
20   * python-feedparser [3] or [4]
21   * python-dateutil [5]
22   * python-flup [6]
23   * python-imaging [7]
24   * python-pybabel [8]
25   * couchdbkit [9]
26   * Django (>= 1.3 [10])
27   * django-registration [11]
28   * django-couchdb-utils [12]
30 Optional:
31   * MySQL Server (>= 5.0)
32   * python-mysqldb [2]
33   * lighttpd (>= 1.4.19)
37   Relational Database
38 =======================
40 The relational database is being replaced by CouchDB in the "couchdb" branch.
41 Currently a relational database is still required for user profile related
42 data.
44 For a production instance you might want to use MySQL, but for a test and
45 development instance a SQLite database should work, too.
47 For setting up a MySQL database you should continue with the following steps.
48 For a SQLite database you can skip to step 3.
51 1. Updating the Settings
53 In mygpo/settings.py a skeleton database setting (DATABASES) is provided.  To
54 use mygpo with a MySQL database, create settings_prod.py and overwrite the
55 settings with something like
57 DATABASES = {
58     'default': {
59         'NAME': 'mygpo',
60         'ENGINE': 'django.db.backends.mysql',
61         'USER': 'mygpo',
62         'PASSWORD': '',
63     }
66 The following instructions will be based on these settings but you are free to
67 adapt them.
70 2. Creating the database
72 In MySQL, do the following:
74   CREATE DATABASE mygpo;
75   GRANT ALL ON mygpo.* TO mygpo@localhost WITH GRANT OPTION;
76   GRANT SUPER ON *.* TO mygpo@localhost;
77   GRANT ALL ON mygpo.* TO mygpo@'%' WITH GRANT OPTION;
78   FLUSH PRIVILEGES;
80 Make sure that MySQL listens only on localhost, or if in doubt, assign a
81 password to the "mygpo" user!
84 3. Initializing an empty Database
86 You can skip this step if you are importing a dump.
88 Run in the mygpo/ subdirectory (possibly after setting the
89 DB parameters in mygpo/settings.py):
91   python manage.py syncdb
93 When asked to create a superuser, you can say YES.
96 4. Importing a Dump
98 A dump contains both the database structure and the data. You can import it
99 with
101   gunzip -c <dumpfile>.sql.gz | mysql -uroot -p mygpo
105   CouchDB
106 ===========
108 A source distribution of CouchDB can be obtained from
110  http://couchdb.apache.org/downloads.html
112 Build and installation instructions can be found at
114  http://wiki.apache.org/couchdb/Installation
117 Non-official third-party binary distributions are available from
119  http://www.couchbase.com/downloads
122 If you want to avoid installing a CouchDB server yourself, you can use a free
123 CouchDB hosting service, for example from
125  http://www.iriscouch.com/service
127 Please note, however, that hosted CouchDB services generally do not provide
128 security or authentication mechanisms, so this might only be useful for
129 development servers.
131 If you don't use a local database, you need to update the COUCHDB_DATABASES
132 setting (see the "Settings" section below).
136 1. Initializing an empty Database
138 To create the database, execute the following on the commandline
140   curl -X PUT http://127.0.0.1:5984/mygpo
142 To initialize the views, execute from the mygpo-Directory
144   python manage.py sync_couchdb
147 2. Importing a Dump
149 To import a CouchDB dump, execute the following from the commandline
151   gunzip -c <dumpfile.couch.gz> | couchdb-load http://127.0.0.1:5984/mygpo
155 3. Building the Views
157 On the first request, CouchDB will build the views. To do this before the first
158 user hits the site (which is, of course, optional), execute
160  bin/touch-views.sh
164   mygpo
165 =========
167 The source for mygpo can be obtained via git
169  git clone git://github.com/gpodder/mygpo.git
170  git checkout couchdb
174   Settings
175 ============
177 Check the settings in mygpo/settings.py. If you want to change any settings,
178 add them to mygpo/settings_prod.py with the correct value.
182   Web-Server
183 ==============
185 Django comes with a development webservice which you can run from the mygpo
186 directory with
188   python manage.py runserver
190 If you want to run a production server, you can set up lighttpd instead
192 There is a mygpo.lighttpd.conf file shipped with the source. Please
193 customize it to your needs, and then include it from your lighttpd
194 main configuration file, for example like this:
196   include "/srv/mygpo/mygpo.lighttpd.conf"
198 The modules you need to enable are: rewrite, fastcgi. On Debian,
199 you can enable these using the "lighty-enable-mod" command:
201   lighty-enable-mod rewrite fastcgi
203 Then restart ligghtd with
205   /etc/init.d/lighttpd restart
209   References
210 ==============
212  [1]  http://mail-archives.apache.org/mod_mbox/couchdb-dev/201010.mbox/<24594469.51751287512786814.JavaMail.jira@thor>
213  [2]  http://sourceforge.net/projects/mysql-python/
214  [3]  http://feedparser.org/
215  [4]  https://github.com/kurtmckee/feedparser/
216  [5]  http://niemeyer.net/python-dateutil
217  [6]  http://trac.saddi.com/flup
218  [7]  http://www.pythonware.com/products/pil/
219  [8]  http://babel.edgewall.org/
220  [9]  https://github.com/stefankoegl/couchdbkit
221  [10] http://www.djangoproject.com/
222  [11] https://bitbucket.org/ubernostrum/django-registration/
223  [12] http://github.com/stefankoegl/django-couchdb-utils/