7 Assuming a clean debian squeeze (stable) installation, use the following steps to run the software.
11 apt-get install git python-django python-django-south python-setuptools python-sphinx python-httplib2
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
24 python manage.py schemamigration im --initial
26 python setup.py build_sphinx
28 It is advised that you create a ``settings.local`` file to place any configuration overrides (at least change ``SECRET_KEY``).
30 Edit ``/etc/apache2/sites-available/pithos`` (change the ``ServerName`` directive)::
33 ServerAdmin webmaster@pithos.dev.grnet.gr
34 ServerName pithos.dev.grnet.gr
36 DocumentRoot /pithos/htdocs
37 Alias /ui "/var/www/pithos_web_client"
38 Alias /docs "/pithos/docs/build/html"
41 Options Indexes FollowSymLinks
48 RewriteRule ^/v(.*) /api/v$1 [PT,NE]
49 RewriteRule ^/public(.*) /api/public$1 [PT,NE]
50 RewriteRule ^/tools(.*) /api/ui$1 [PT,NE]
51 RewriteRule ^/im(.*) https://%{HTTP_HOST}%{REQUEST_URI} [NE]
52 RewriteRule ^/login(.*) https://%{HTTP_HOST}%{REQUEST_URI} [NE]
54 WSGIScriptAlias /api /pithos/pithos/wsgi/pithos.wsgi
55 # WSGIDaemonProcess pithos
56 # WSGIProcessGroup pithos
59 ErrorLog ${APACHE_LOG_DIR}/pithos.error.log
60 CustomLog ${APACHE_LOG_DIR}/pithos.access.log combined
63 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)::
66 <VirtualHost _default_:443>
67 ServerAdmin webmaster@pithos.dev.grnet.gr
68 ServerName pithos.dev.grnet.gr
70 DocumentRoot /pithos/htdocs
71 Alias /ui "/var/www/pithos_web_client"
72 Alias /docs "/pithos/docs/build/html"
75 Options Indexes FollowSymLinks
82 RewriteRule ^/v(.*) /api/v$1 [PT,NE]
83 RewriteRule ^/public(.*) /api/public$1 [PT,NE]
84 RewriteRule ^/tools(.*) /api/ui$1 [PT,NE]
85 RewriteRule ^/im(.*) /api/im$1 [PT,NE]
86 RewriteRule ^/login(.*) /api/im/login/dummy$1 [PT,NE]
88 WSGIScriptAlias /api /pithos/pithos/wsgi/pithos.wsgi
89 # WSGIDaemonProcess pithos
90 # WSGIProcessGroup pithos
93 ErrorLog ${APACHE_LOG_DIR}/pithos.error.log
94 CustomLog ${APACHE_LOG_DIR}/pithos.access.log combined
97 SSLCertificateFile /etc/ssl/certs/pithos.dev.grnet.gr.crt
98 SSLCertificateKeyFile /etc/ssl/private/pithos.dev.grnet.gr.key
102 Add in ``/etc/apache2/mods-available/wsgi.conf``::
104 WSGIChunkedRequest On
106 Configure and run apache::
113 mkdir /var/www/pithos
114 mkdir /var/www/pithos_web_client
115 /etc/init.d/apache2 restart
117 Useful alias to add in ``~/.bashrc``::
119 alias pithos-sync='cd /pithos && git pull && python setup.py build_sphinx && cd pithos && python manage.py migrate im && /etc/init.d/apache2 restart'
124 Add in ``/etc/apt/sources.list``::
126 deb http://backports.debian.org/debian-backports squeeze-backports main
131 apt-get -t squeeze-backports install gunicorn
132 apt-get -t squeeze-backports install python-gevent
134 Create ``/etc/gunicorn.d/pithos``::
138 'working_dir': '/pithos/pithos',
143 '--worker-class=egg:gunicorn#gevent',
146 '/pithos/pithos/settings.py',
150 Replace the ``WSGI*`` directives in ``/etc/apache2/sites-available/pithos`` and ``/etc/apache2/sites-available/pithos-ssl`` with::
157 SetEnv proxy-sendchunked
159 ProxyErrorOverride off
161 ProxyPass /api http://localhost:8080 retry=0
162 ProxyPassReverse /api http://localhost:8080
164 Make sure that in ``settings.local``::
166 USE_X_FORWARDED_HOST = True
170 /etc/init.d/gunicorn restart
173 /etc/init.d/apache2 restart
175 If experiencing timeout problems, try adding to ``/etc/gunicorn.d/pithos``::
186 apt-get install libapache2-mod-shib2
188 Setup the files in ``/etc/shibboleth``.
190 Add in ``/etc/apache2/sites-available/pithos-ssl``::
192 ShibConfig /etc/shibboleth/shibboleth2.xml
193 Alias /shibboleth-sp /usr/share/shibboleth
195 <Location /api/im/login/shibboleth>
197 ShibRequireSession On
202 Configure and run apache::
205 /etc/init.d/apache2 restart
206 /etc/init.d/shibd restart
208 The following tokens should be available at the destination, after passing through the apache module::
210 eppn # eduPersonPrincipalName
211 Shib-InetOrgPerson-givenName
213 Shib-Person-commonName
214 Shib-InetOrgPerson-displayName
221 If using MySQL instead of SQLite for the database engine, consider the following.
225 apt-get install mysql-server
227 Add in ``/etc/mysql/conf.d/pithos.cnf``::
230 sql-mode="NO_AUTO_VALUE_ON_ZERO"
232 Edit ``/etc/mysql/my.cnf`` to allow network connections and restart the server.
234 Create database and user::
236 CREATE DATABASE pithos CHARACTER SET utf8 COLLATE utf8_bin;
237 GRANT ALL ON pithos.* TO pithos@localhost IDENTIFIED BY 'password';
238 GRANT ALL ON pithos.* TO pithos@'%' IDENTIFIED BY 'password';
242 apt-get install mysql-client
244 It helps to create a ``~/.my.cnf`` file, for automatically connecting to the server::
248 password = 'password'
249 host = pithos-storage.dev.grnet.gr
257 If using PostgreSQL instead of SQLite for the database engine, consider the following.
261 apt-get install postgresql
263 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.
265 Create database and user::
267 CREATE DATABASE pithos WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0;
268 CREATE USER pithos WITH PASSWORD 'password';
269 GRANT ALL PRIVILEGES ON DATABASE pithos TO pithos;
273 apt-get install postgresql-client
275 It helps to create a ``~/.pgpass`` file, for automatically passing the password to the server::
277 pithos-storage.dev.grnet.gr:5432:pithos:pithos:password
281 psql -h pithos-storage.dev.grnet.gr -U pithos