7 Assuming a clean debian squeeze (stable) installation, use the following steps to run the software.
11 apt-get install git python-django python-setuptools python-sphinx
12 apt-get install python-sqlalchemy python-mysqldb python-psycopg2
13 apt-get install apache2 libapache2-mod-wsgi
18 git clone https://code.grnet.gr/git/pithos
23 python manage.py syncdb
25 python setup.py build_sphinx
27 It is advised that you create a ``settings.local`` file to place any configuration overrides (at least change ``SECRET_KEY``).
29 Edit ``/etc/apache2/sites-available/pithos`` (change the ``ServerName`` directive)::
32 ServerAdmin webmaster@pithos.dev.grnet.gr
33 ServerName pithos.dev.grnet.gr
35 DocumentRoot /pithos/htdocs
36 Alias /ui "/var/www/pithos_web_client"
37 Alias /docs "/pithos/docs/build/html"
40 Options Indexes FollowSymLinks
50 RewriteRule ^/v(.*) /api/v$1 [PT,NE]
51 RewriteRule ^/public(.*) /api/public$1 [PT,NE]
52 RewriteRule ^/tools(.*) /api/ui$1 [PT,NE]
53 RewriteRule ^/im(.*) https://%{HTTP_HOST}%{REQUEST_URI} [NE]
54 RewriteRule ^/login(.*) https://%{HTTP_HOST}%{REQUEST_URI} [NE]
56 RequestHeader set X-Forwarded-Protocol "http"
58 WSGIScriptAlias /api /pithos/pithos/wsgi/pithos.wsgi
59 # WSGIDaemonProcess pithos
60 # WSGIProcessGroup pithos
63 ErrorLog ${APACHE_LOG_DIR}/pithos.error.log
64 CustomLog ${APACHE_LOG_DIR}/pithos.access.log combined
67 To disable non-SSL connections, ``/etc/apache2/sites-available/pithos`` should be::
70 ServerAdmin webmaster@pithos.dev.grnet.gr
71 ServerName pithos.dev.grnet.gr
74 RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
77 Edit ``/etc/apache2/sites-available/pithos-ssl`` (assuming files in ``/etc/ssl/private/pithos.dev.grnet.gr.key`` and ``/etc/ssl/certs/pithos.dev.grnet.gr.crt`` - change the ``ServerName`` directive)::
80 <VirtualHost _default_:443>
81 ServerAdmin webmaster@pithos.dev.grnet.gr
82 ServerName pithos.dev.grnet.gr
84 DocumentRoot /pithos/htdocs
85 Alias /ui "/var/www/pithos_web_client"
86 Alias /docs "/pithos/docs/build/html"
89 Options Indexes FollowSymLinks
99 RewriteRule ^/v(.*) /api/v$1 [PT,NE]
100 RewriteRule ^/public(.*) /api/public$1 [PT,NE]
101 RewriteRule ^/tools(.*) /api/ui$1 [PT,NE]
102 RewriteRule ^/im(.*) /api/im$1 [PT,NE]
103 RewriteRule ^/login(.*) /api/im/login/dummy$1 [PT,NE]
105 RequestHeader set X-Forwarded-Protocol "https"
107 WSGIScriptAlias /api /pithos/pithos/wsgi/pithos.wsgi
108 # WSGIDaemonProcess pithos
109 # WSGIProcessGroup pithos
112 ErrorLog ${APACHE_LOG_DIR}/pithos.error.log
113 CustomLog ${APACHE_LOG_DIR}/pithos.access.log combined
116 SSLCertificateFile /etc/ssl/certs/pithos.dev.grnet.gr.crt
117 SSLCertificateKeyFile /etc/ssl/private/pithos.dev.grnet.gr.key
121 Add in ``/etc/apache2/mods-available/wsgi.conf``::
123 WSGIChunkedRequest On
125 Make sure the data folder is writable by the web server user::
127 chown -R www-data:www-data /pithos/pithos/data
129 If using an SQLite database, the same goes for the database file and the containing folder::
131 chown www-data:www-data /pithos/pithos/
132 chown www-data:www-data /pithos/pithos/backend.db
134 Configure and run apache::
141 mkdir /var/www/pithos
142 mkdir /var/www/pithos_web_client
143 /etc/init.d/apache2 restart
145 Useful alias to add in ``~/.bashrc``::
147 alias sync-pithos='cd /pithos && git pull && python setup.py build_sphinx && /etc/init.d/apache2 restart'
152 Add in ``/etc/apt/sources.list``::
154 deb http://backports.debian.org/debian-backports squeeze-backports main
159 apt-get -t squeeze-backports install gunicorn
160 apt-get -t squeeze-backports install python-gevent
162 Create ``/etc/gunicorn.d/pithos``::
166 'working_dir': '/pithos/pithos',
171 '--worker-class=egg:gunicorn#gevent',
174 '/pithos/pithos/settings.py',
178 Replace the ``WSGI*`` directives in ``/etc/apache2/sites-available/pithos`` and ``/etc/apache2/sites-available/pithos-ssl`` with::
185 SetEnv proxy-sendchunked
187 ProxyErrorOverride off
189 ProxyPass /api http://localhost:8080 retry=0
190 ProxyPassReverse /api http://localhost:8080
192 Make sure that in ``settings.local``::
194 USE_X_FORWARDED_HOST = True
198 /etc/init.d/gunicorn restart
201 /etc/init.d/apache2 restart
203 If experiencing timeout problems, try adding to ``/etc/gunicorn.d/pithos``::
214 apt-get install libapache2-mod-shib2
216 Setup the files in ``/etc/shibboleth``.
218 Add in ``/etc/apache2/sites-available/pithos-ssl``::
220 ShibConfig /etc/shibboleth/shibboleth2.xml
221 Alias /shibboleth-sp /usr/share/shibboleth
223 <Location /api/im/login/shibboleth>
225 ShibRequireSession On
230 Configure and run apache::
233 /etc/init.d/apache2 restart
234 /etc/init.d/shibd restart
236 The following tokens should be available at the destination, after passing through the apache module::
238 eppn # eduPersonPrincipalName
239 Shib-InetOrgPerson-givenName
241 Shib-Person-commonName
242 Shib-InetOrgPerson-displayName
249 If using MySQL instead of SQLite for the database engine, consider the following.
253 apt-get install mysql-server
255 Add in ``/etc/mysql/conf.d/pithos.cnf``::
258 sql-mode="NO_AUTO_VALUE_ON_ZERO"
260 Edit ``/etc/mysql/my.cnf`` to allow network connections and restart the server.
262 Create database and user::
264 CREATE DATABASE pithos CHARACTER SET utf8 COLLATE utf8_bin;
265 GRANT ALL ON pithos.* TO pithos@localhost IDENTIFIED BY 'password';
266 GRANT ALL ON pithos.* TO pithos@'%' IDENTIFIED BY 'password';
270 apt-get install mysql-client
272 It helps to create a ``~/.my.cnf`` file, for automatically connecting to the server::
276 password = 'password'
277 host = pithos-storage.dev.grnet.gr
285 If using PostgreSQL instead of SQLite for the database engine, consider the following.
289 apt-get install postgresql
291 Edit ``/etc/postgresql/8.4/main/postgresql.conf`` and ``/etc/postgresql/8.4/main/pg_hba.conf`` to allow network connections and restart the server.
293 Create database and user::
295 CREATE DATABASE pithos WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0;
296 CREATE USER pithos WITH PASSWORD 'password';
297 GRANT ALL PRIVILEGES ON DATABASE pithos TO pithos;
301 apt-get install postgresql-client
303 It helps to create a ``~/.pgpass`` file, for automatically passing the password to the server::
305 pithos-storage.dev.grnet.gr:5432:pithos:pithos:password
309 psql -h pithos-storage.dev.grnet.gr -U pithos