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.
15 When no version number is indicated, it is advisable to install the current
16 development version from the repository.
19 * MySQL Server (>= 5.0)
20 * CouchDB (>= 1.0, incl Patch from [1])
22 * lighttpd (>= 1.4.19)
23 * python-feedparser [3] or [4]
29 * Django (>= 1.2.2, [10])
30 * django-registration [11]
31 * django-couchdb-utils [12]
37 1. Updating the Settings
39 In mygpo/settings.py a skeleton database setting (DATABASES) is provided. To
40 use mygpo with a MySQL database, create settings_prod.py and overwrite the
41 settings with something like
46 'ENGINE': 'django.db.backends.mysql',
52 The following instructions will be based on these settings but you are free to
56 2. Creating the database
58 In MySQL, do the following (the SUPER grant is needed for
59 triggers to work in MySQL 5.0):
61 CREATE DATABASE mygpo;
62 GRANT ALL ON mygpo.* TO mygpo@localhost WITH GRANT OPTION;
63 GRANT SUPER ON *.* TO mygpo@localhost;
64 GRANT ALL ON mygpo.* TO mygpo@'%' WITH GRANT OPTION;
65 GRANT SUPER ON *.* TO mygpo@'%';
68 Make sure that MySQL listens only on localhost, or if in
69 doubt, assign a password to the "mygpo" user!
72 3. Initializing an empty Database
74 You can skip this step if you are importing a dump.
76 Run in the mygpo/ subdirectory (possibly after setting the
77 DB parameters in mygpo/settings.py):
79 python manage.py syncdb
81 When asked to create a superuser, you can say YES.
83 Now, run every SQL-Script in the install/ subdirectory, starting
84 with "create.sql" and working your way all the way through the
85 update scripts (these are split because we are doing incremental
86 schema updates on the production server).
88 If you are really doing an initial installation, you can also use
89 the "install.sh" script which runs all scripts on the local MySQL
90 server in the correct order. You should not use this script to
91 upgrade the database, as data loss may occur. You have been warned.
96 A dump contains both the database structure and the data. You can import it
99 gunzip -c <dumpfile>.sql.gz | mysql -uroot -p mygpo
105 1. Initializing an empty Database
107 To create the database, execute the following on the commandline
109 curl -X PUT http://127.0.0.1:5984/mygpo
111 To initialize the views, execute from the mygpo-Directory
113 python manage.py syncdb
118 To import a CouchDB dump, execute the following from the commandline
120 gunzip -c <dumpfile.couch.gz> | couchdb-load http://127.0.0.1:5984/mygpo
123 3. Building the Views
125 On the first request, CouchDB will build the views. To do this before the first
126 user hits the site (which is, of course, optional), execute the following
128 curl -X GET http://127.0.0.1:5984/mygpo/_design/core/_view/podcasts_by_url?limit=1
129 curl -X GET http://127.0.0.1:5984/mygpo/_design/directory/_view/toplist
135 Django comes with a development webservice which you can run from the mygpo
138 python manage.py runserver
140 If you want to run a production server, you can set up lighttpd instead
142 There is a mygpo.lighttpd.conf file shipped with the source. Please
143 customize it to your needs, and then include it from your lighttpd
144 main configuration file, for example like this:
146 include "/srv/mygpo/mygpo.lighttpd.conf"
148 The modules you need to enable are: rewrite, fastcgi. On Debian,
149 you can enable these using the "lighty-enable-mod" command:
151 lighty-enable-mod rewrite fastcgi
153 Then restart ligghtd with
155 /etc/init.d/lighttpd restart
161 Check the settings in mygpo/settings.py. If you want to change any settings,
162 add them to mygpo/settings_prod.py with the correct value.
169 [1] http://mail-archives.apache.org/mod_mbox/couchdb-dev/201010.mbox/<24594469.51751287512786814.JavaMail.jira@thor>
170 [2] http://sourceforge.net/projects/mysql-python/
171 [3] http://feedparser.org/
172 [4] https://github.com/kurtmckee/feedparser/
173 [5] http://niemeyer.net/python-dateutil
174 [6] http://trac.saddi.com/flup
175 [7] http://www.pythonware.com/products/pil/
176 [8] http://babel.edgewall.org/
177 [9] https://github.com/stefankoegl/couchdbkit
178 [10] http://www.djangoproject.com/
179 [11] https://bitbucket.org/ubernostrum/django-registration/
180 [12] http://github.com/stefankoegl/django-couchdb-utils/