merge toplist-views into one
[mygpo.git] / INSTALL
blob9d5186efd34141b21b177cb3179b7416d0cb4ad6
3                    Deployment instructions for gpodder.net
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   * MySQL Server (>= 5.0)
20   * CouchDB (>= 1.0, incl Patch from [1])
21   * python-mysqldb [2]
22   * lighttpd (>= 1.4.19)
23   * python-feedparser [3] or [4]
24   * python-dateutil [5]
25   * python-flup [6]
26   * python-imaging [7]
27   * python-pybabel [8]
28   * couchdbkit [9]
29   * Django (>= 1.2.2, [10])
30   * django-registration [11]
33   MySQL
34 =========
36 1. Updating the Settings
38 In mygpo/settings.py a skeleton database setting (DATABASES) is provided.  To
39 use mygpo with a MySQL database, create settings_prod.py and overwrite the
40 settings with something like
42 DATABASES = {
43     'default': {
44         'NAME': 'mygpo',
45         'ENGINE': 'django.db.backends.mysql',
46         'USER': 'mygpo',
47         'PASSWORD': '',
48     }
51 The following instructions will be based on these settings but you are free to
52 adapt them.
55 2. Creating the database
57 In MySQL, do the following (the SUPER grant is needed for
58 triggers to work in MySQL 5.0):
60   CREATE DATABASE mygpo;
61   GRANT ALL ON mygpo.* TO mygpo@localhost WITH GRANT OPTION;
62   GRANT SUPER ON *.* TO mygpo@localhost;
63   GRANT ALL ON mygpo.* TO mygpo@'%' WITH GRANT OPTION;
64   GRANT SUPER ON *.* TO mygpo@'%';
65   FLUSH PRIVILEGES;
67 Make sure that MySQL listens only on localhost, or if in
68 doubt, assign a password to the "mygpo" user!
71 3. Initializing an empty Database
73 You can skip this step if you are importing a dump.
75 Run in the mygpo/ subdirectory (possibly after setting the
76 DB parameters in mygpo/settings.py):
78   python manage.py syncdb
80 When asked to create a superuser, you can say YES.
82 Now, run every SQL-Script in the install/ subdirectory, starting
83 with "create.sql" and working your way all the way through the
84 update scripts (these are split because we are doing incremental
85 schema updates on the production server).
87 If you are really doing an initial installation, you can also use
88 the "install.sh" script which runs all scripts on the local MySQL
89 server in the correct order. You should not use this script to
90 upgrade the database, as data loss may occur. You have been warned.
93 4. Importing a Dump
95 A dump contains both the database structure and the data. You can import it
96 with
98   gunzip -c <dumpfile>.sql.gz | mysql -uroot -p mygpo
101   CouchDB
102 ===========
104 1. Initializing an empty Database
106 To create the database, execute the following on the commandline
108   curl -X PUT http://127.0.0.1:5984/mygpo
110 To initialize the views, execute from the mygpo-Directory
112   python manage.py syncdb
115 2. Importing a Dump
117 To import a CouchDB dump, execute the following from the commandline
119   gunzip -c <dumpfile.couch.gz> | couchdb-load http://127.0.0.1:5984/mygpo
122 3. Building the Views
124 On the first request, CouchDB will build the views. To do this before the first
125 user hits the site (which is, of course, optional), execute the following
127   curl -X GET http://127.0.0.1:5984/mygpo/_design/core/_view/podcasts_by_url?limit=1
128   curl -X GET http://127.0.0.1:5984/mygpo/_design/directory/_view/toplist
131   Web-Server
132 ==============
134 Django comes with a development webservice which you can run from the mygpo
135 directory with
137   python manage.py runserver
139 If you want to run a production server, you can set up lighttpd instead
141 There is a mygpo.lighttpd.conf file shipped with the source. Please
142 customize it to your needs, and then include it from your lighttpd
143 main configuration file, for example like this:
145   include "/srv/mygpo/mygpo.lighttpd.conf"
147 The modules you need to enable are: rewrite, fastcgi. On Debian,
148 you can enable these using the "lighty-enable-mod" command:
150   lighty-enable-mod rewrite fastcgi
152 Then restart ligghtd with
154   /etc/init.d/lighttpd restart
157   Settings
158 ============
160 Check the settings in mygpo/settings.py. If you want to change any settings,
161 add them to mygpo/settings_prod.py with the correct value.
165   References
166 ==============
168  [1]  http://mail-archives.apache.org/mod_mbox/couchdb-dev/201010.mbox/<24594469.51751287512786814.JavaMail.jira@thor>
169  [2]  http://sourceforge.net/projects/mysql-python/
170  [3]  http://feedparser.org/
171  [4]  https://github.com/kurtmckee/feedparser/
172  [5]  http://niemeyer.net/python-dateutil
173  [6]  http://trac.saddi.com/flup
174  [7]  http://www.pythonware.com/products/pil/
175  [8]  http://babel.edgewall.org/
176  [9]  https://github.com/stefankoegl/couchdbkit
177  [10] http://www.djangoproject.com/
178  [11] https://bitbucket.org/ubernostrum/django-registration/