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 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
20 Setup the files (choose where to store data in ``settings.py`` and change ``SECRET_KEY``)::
23 cp settings.py.dist settings.py
24 python manage.py syncdb
26 python setup.py build_sphinx
28 Edit ``/etc/apache2/sites-available/pithos`` (change the ``ServerName`` directive)::
31 ServerAdmin webmaster@pithos.dev.grnet.gr
32 ServerName pithos.dev.grnet.gr
34 DocumentRoot /pithos/htdocs
35 Alias /ui "/var/www/pithos_web_client"
36 Alias /docs "/pithos/docs/build/html"
39 Options Indexes FollowSymLinks
46 RewriteRule ^/v(.*) /api/v$1 [PT]
47 RewriteRule ^/public(.*) /api/public$1 [PT]
48 RewriteRule ^/im(.*) https://%{HTTP_HOST}%{REQUEST_URI}
50 WSGIScriptAlias /api /pithos/pithos/wsgi/pithos.wsgi
51 # WSGIDaemonProcess pithos
52 # WSGIProcessGroup pithos
55 ErrorLog ${APACHE_LOG_DIR}/pithos.error.log
56 CustomLog ${APACHE_LOG_DIR}/pithos.access.log combined
59 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)::
62 <VirtualHost _default_:443>
63 ServerAdmin webmaster@pithos.dev.grnet.gr
64 ServerName pithos.dev.grnet.gr
66 DocumentRoot /pithos/htdocs
67 Alias /ui "/var/www/pithos_web_client"
68 Alias /docs "/pithos/docs/build/html"
71 Options Indexes FollowSymLinks
78 RewriteRule ^/v(.*) /api/v$1 [PT]
79 RewriteRule ^/public(.*) /api/public$1 [PT]
80 RewriteRule ^/im(.*) /api/im$1 [PT]
82 WSGIScriptAlias /api /pithos/pithos/wsgi/pithos.wsgi
83 # WSGIDaemonProcess pithos
84 # WSGIProcessGroup pithos
86 ShibConfig /etc/shibboleth/shibboleth2.xml
87 Alias /shibboleth-sp /usr/share/shibboleth
89 <Location /api/im/login/shibboleth>
97 ErrorLog ${APACHE_LOG_DIR}/pithos.error.log
98 CustomLog ${APACHE_LOG_DIR}/pithos.access.log combined
101 SSLCertificateFile /etc/ssl/certs/pithos.dev.grnet.gr.crt
102 SSLCertificateKeyFile /etc/ssl/private/pithos.dev.grnet.gr.key
106 Add in ``/etc/apache2/mods-available/wsgi.conf``::
108 WSGIChunkedRequest On
110 Configure and run apache::
117 mkdir /var/www/pithos
118 mkdir /var/www/pithos_web_client
119 /etc/init.d/apache2 restart
121 Useful alias to add in ``~/.bashrc``::
123 alias pithos-sync='cd /pithos && git pull && python setup.py build_sphinx && /etc/init.d/apache2 restart'
128 Add in ``/etc/apt/sources.list``::
130 deb http://backports.debian.org/debian-backports squeeze-backports main
135 apt-get -t squeeze-backports install gunicorn
136 apt-get -t squeeze-backports install python-gevent
138 Create ``/etc/gunicorn.d/pithos``::
142 'working_dir': '/pithos/pithos',
147 '--worker-class=egg:gunicorn#gevent',
150 '/pithos/pithos/settings.py',
154 Replace the ``WSGI*`` directives in ``/etc/apache2/sites-available/pithos`` and ``/etc/apache2/sites-available/pithos-ssl`` with::
161 SetEnv proxy-sendchunked
163 ProxyErrorOverride off
165 ProxyPass /api http://localhost:8080 retry=0
166 ProxyPassReverse /api http://localhost:8080
170 /etc/init.d/gunicorn restart
173 /etc/init.d/apache2 restart
180 apt-get install libapache2-mod-shib2
182 Setup the files in ``/etc/shibboleth``.
184 Add in ``/etc/apache2/sites-available/pithos-ssl``::
186 ShibConfig /etc/shibboleth/shibboleth2.xml
187 Alias /shibboleth-sp /usr/share/shibboleth
189 <Location /api/login>
191 ShibRequireSession On
196 Configure and run apache::
199 /etc/init.d/apache2 restart
200 /etc/init.d/shibd restart
202 The following tokens should be available at the destination, after passing through the apache module::
204 eppn # eduPersonPrincipalName
205 Shib-InetOrgPerson-givenName
207 Shib-Person-commonName
208 Shib-InetOrgPerson-displayName
215 If using MySQL instead of SQLite for the database engine, consider the following.
219 apt-get install mysql-server
221 Add in ``/etc/mysql/conf.d/pithos.cnf``::
224 sql-mode="NO_AUTO_VALUE_ON_ZERO"
226 Edit ``/etc/mysql/my.cnf`` to allow network connections and restart the server.
228 Create database and user::
230 CREATE DATABASE pithos CHARACTER SET utf8 COLLATE utf8_bin;
231 GRANT ALL ON pithos.* TO pithos@localhost IDENTIFIED BY 'password';
232 GRANT ALL ON pithos.* TO pithos@'%' IDENTIFIED BY 'password';
236 apt-get install mysql-client
238 It helps to create a ``~/.my.cnf`` file, for automatically connecting to the server::
242 password = 'password'
243 host = pithos-storage.dev.grnet.gr
251 If using PostgreSQL instead of SQLite for the database engine, consider the following.
255 apt-get install postgresql
257 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.
259 Create database and user::
261 CREATE DATABASE pithos WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0;
262 CREATE USER pithos WITH PASSWORD 'password';
263 GRANT ALL PRIVILEGES ON DATABASE pithos TO pithos;
267 apt-get install postgresql-client
269 It helps to create a ``~/.pgpass`` file, for automatically passing the password to the server::
271 pithos-storage.dev.grnet.gr:5432:pithos:pithos:password
275 psql -h pithos-storage.dev.grnet.gr -U pithos