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 ^/tools(.*) /api/ui$1 [PT]
49 RewriteRule ^/im(.*) https://%{HTTP_HOST}%{REQUEST_URI}
50 RewriteRule ^/login(.*) https://%{HTTP_HOST}%{REQUEST_URI}
52 WSGIScriptAlias /api /pithos/pithos/wsgi/pithos.wsgi
53 # WSGIDaemonProcess pithos
54 # WSGIProcessGroup pithos
57 ErrorLog ${APACHE_LOG_DIR}/pithos.error.log
58 CustomLog ${APACHE_LOG_DIR}/pithos.access.log combined
61 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)::
64 <VirtualHost _default_:443>
65 ServerAdmin webmaster@pithos.dev.grnet.gr
66 ServerName pithos.dev.grnet.gr
68 DocumentRoot /pithos/htdocs
69 Alias /ui "/var/www/pithos_web_client"
70 Alias /docs "/pithos/docs/build/html"
73 Options Indexes FollowSymLinks
80 RewriteRule ^/v(.*) /api/v$1 [PT]
81 RewriteRule ^/public(.*) /api/public$1 [PT]
82 RewriteRule ^/tools(.*) /api/ui$1 [PT]
83 RewriteRule ^/im(.*) /api/im$1 [PT]
84 RewriteRule ^/login(.*) /api/im/login/dummy$1 [PT]
86 WSGIScriptAlias /api /pithos/pithos/wsgi/pithos.wsgi
87 # WSGIDaemonProcess pithos
88 # WSGIProcessGroup pithos
90 ShibConfig /etc/shibboleth/shibboleth2.xml
91 Alias /shibboleth-sp /usr/share/shibboleth
93 <Location /api/im/login/shibboleth>
101 ErrorLog ${APACHE_LOG_DIR}/pithos.error.log
102 CustomLog ${APACHE_LOG_DIR}/pithos.access.log combined
105 SSLCertificateFile /etc/ssl/certs/pithos.dev.grnet.gr.crt
106 SSLCertificateKeyFile /etc/ssl/private/pithos.dev.grnet.gr.key
110 Add in ``/etc/apache2/mods-available/wsgi.conf``::
112 WSGIChunkedRequest On
114 Configure and run apache::
121 mkdir /var/www/pithos
122 mkdir /var/www/pithos_web_client
123 /etc/init.d/apache2 restart
125 Useful alias to add in ``~/.bashrc``::
127 alias pithos-sync='cd /pithos && git pull && python setup.py build_sphinx && /etc/init.d/apache2 restart'
132 Add in ``/etc/apt/sources.list``::
134 deb http://backports.debian.org/debian-backports squeeze-backports main
139 apt-get -t squeeze-backports install gunicorn
140 apt-get -t squeeze-backports install python-gevent
142 Create ``/etc/gunicorn.d/pithos``::
146 'working_dir': '/pithos/pithos',
151 '--worker-class=egg:gunicorn#gevent',
154 '/pithos/pithos/settings.py',
158 Replace the ``WSGI*`` directives in ``/etc/apache2/sites-available/pithos`` and ``/etc/apache2/sites-available/pithos-ssl`` with::
165 SetEnv proxy-sendchunked
167 ProxyErrorOverride off
169 ProxyPass /api http://localhost:8080 retry=0
170 ProxyPassReverse /api http://localhost:8080
174 /etc/init.d/gunicorn restart
177 /etc/init.d/apache2 restart
184 apt-get install libapache2-mod-shib2
186 Setup the files in ``/etc/shibboleth``.
188 Add in ``/etc/apache2/sites-available/pithos-ssl``::
190 ShibConfig /etc/shibboleth/shibboleth2.xml
191 Alias /shibboleth-sp /usr/share/shibboleth
193 <Location /api/login>
195 ShibRequireSession On
200 Configure and run apache::
203 /etc/init.d/apache2 restart
204 /etc/init.d/shibd restart
206 The following tokens should be available at the destination, after passing through the apache module::
208 eppn # eduPersonPrincipalName
209 Shib-InetOrgPerson-givenName
211 Shib-Person-commonName
212 Shib-InetOrgPerson-displayName
219 If using MySQL instead of SQLite for the database engine, consider the following.
223 apt-get install mysql-server
225 Add in ``/etc/mysql/conf.d/pithos.cnf``::
228 sql-mode="NO_AUTO_VALUE_ON_ZERO"
230 Edit ``/etc/mysql/my.cnf`` to allow network connections and restart the server.
232 Create database and user::
234 CREATE DATABASE pithos CHARACTER SET utf8 COLLATE utf8_bin;
235 GRANT ALL ON pithos.* TO pithos@localhost IDENTIFIED BY 'password';
236 GRANT ALL ON pithos.* TO pithos@'%' IDENTIFIED BY 'password';
240 apt-get install mysql-client
242 It helps to create a ``~/.my.cnf`` file, for automatically connecting to the server::
246 password = 'password'
247 host = pithos-storage.dev.grnet.gr
255 If using PostgreSQL instead of SQLite for the database engine, consider the following.
259 apt-get install postgresql
261 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.
263 Create database and user::
265 CREATE DATABASE pithos WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0;
266 CREATE USER pithos WITH PASSWORD 'password';
267 GRANT ALL PRIVILEGES ON DATABASE pithos TO pithos;
271 apt-get install postgresql-client
273 It helps to create a ``~/.pgpass`` file, for automatically passing the password to the server::
275 pithos-storage.dev.grnet.gr:5432:pithos:pithos:password
279 psql -h pithos-storage.dev.grnet.gr -U pithos