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
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 ^/login(.*) https://%{HTTP_HOST}%{REQUEST_URI}
49 RewriteRule ^/admin(.*) https://%{HTTP_HOST}%{REQUEST_URI}
51 WSGIScriptAlias /api /pithos/pithos/wsgi/pithos.wsgi
52 # WSGIDaemonProcess pithos
53 # WSGIProcessGroup pithos
56 ErrorLog ${APACHE_LOG_DIR}/pithos.error.log
57 CustomLog ${APACHE_LOG_DIR}/pithos.access.log combined
60 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)::
63 <VirtualHost _default_:443>
64 ServerAdmin webmaster@pithos.dev.grnet.gr
65 ServerName pithos.dev.grnet.gr
67 DocumentRoot /pithos/htdocs
68 Alias /ui "/var/www/pithos_web_client"
69 Alias /docs "/pithos/docs/build/html"
72 Options Indexes FollowSymLinks
79 RewriteRule ^/v(.*) /api/v$1 [PT]
80 RewriteRule ^/public(.*) /api/public$1 [PT]
81 RewriteRule ^/login(.*) /api/login$1 [PT]
82 RewriteRule ^/admin(.*) /api/admin$1 [PT]
84 WSGIScriptAlias /api /pithos/pithos/wsgi/pithos.wsgi
85 # WSGIDaemonProcess pithos
86 # WSGIProcessGroup pithos
88 ShibConfig /etc/shibboleth/shibboleth2.xml
89 Alias /shibboleth-sp /usr/share/shibboleth
99 ErrorLog ${APACHE_LOG_DIR}/pithos.error.log
100 CustomLog ${APACHE_LOG_DIR}/pithos.access.log combined
103 SSLCertificateFile /etc/ssl/certs/pithos.dev.grnet.gr.crt
104 SSLCertificateKeyFile /etc/ssl/private/pithos.dev.grnet.gr.key
108 Add in ``/etc/apache2/mods-available/wsgi.conf``::
110 WSGIChunkedRequest On
112 Configure and run apache::
119 mkdir /var/www/pithos
120 mkdir /var/www/pithos_web_client
121 /etc/init.d/apache2 restart
123 Useful alias to add in ``~/.bashrc``::
125 alias pithos-sync='cd /pithos && git pull && python setup.py build_sphinx && /etc/init.d/apache2 restart'
130 Add in ``/etc/apt/sources.list``::
132 deb http://backports.debian.org/debian-backports squeeze-backports main
137 apt-get -t squeeze-backports install gunicorn
138 apt-get -t squeeze-backports install python-gevent
140 Create ``/etc/gunicorn.d/pithos``::
144 'working_dir': '/pithos/pithos',
149 '--worker-class=egg:gunicorn#gevent',
152 '/pithos/pithos/settings.py',
156 Replace the ``WSGI*`` directives in ``/etc/apache2/sites-available/pithos`` and ``/etc/apache2/sites-available/pithos-ssl`` with::
163 SetEnv proxy-sendchunked
165 ProxyErrorOverride off
167 ProxyPass /api http://localhost:8080 retry=0
168 ProxyPassReverse /api http://localhost:8080
172 /etc/init.d/gunicorn restart
175 /etc/init.d/apache2 restart
182 apt-get install libapache2-mod-shib2
184 Setup the files in ``/etc/shibboleth``.
186 Add in ``/etc/apache2/sites-available/pithos-ssl``::
188 ShibConfig /etc/shibboleth/shibboleth2.xml
189 Alias /shibboleth-sp /usr/share/shibboleth
191 <Location /api/login>
193 ShibRequireSession On
198 Configure and run apache::
201 /etc/init.d/apache2 restart
202 /etc/init.d/shibd restart
204 The following tokens should be available at the destination, after passing through the apache module::
206 eppn # eduPersonPrincipalName
207 Shib-InetOrgPerson-givenName
209 Shib-Person-commonName
210 Shib-InetOrgPerson-displayName
217 If using MySQL instead of SQLite for the database engine, consider the following.
221 apt-get install mysql-server
223 Add in ``/etc/mysql/conf.d/pithos.cnf``::
226 sql-mode="NO_AUTO_VALUE_ON_ZERO"
228 Edit ``/etc/mysql/my.cnf`` to allow network connections and restart the server.
230 Create database and user::
232 CREATE DATABASE pithos CHARACTER SET utf8 COLLATE utf8_bin;
233 GRANT ALL ON pithos.* TO pithos@localhost IDENTIFIED BY 'password';
234 GRANT ALL ON pithos.* TO pithos@'%' IDENTIFIED BY 'password';
238 apt-get install mysql-client
240 It helps to create a ``~/.my.cnf`` file, for automatically connecting to the server::
244 password = 'password'
245 host = pithos-storage.dev.grnet.gr
253 If using PostgreSQL instead of SQLite for the database engine, consider the following.
257 apt-get install postgresql
259 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.
261 Create database and user::
263 CREATE DATABASE pithos WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0;
264 CREATE USER pithos WITH PASSWORD 'password';
265 GRANT ALL PRIVILEGES ON DATABASE pithos TO pithos;
269 apt-get install postgresql-client
271 It helps to create a ``~/.pgpass`` file, for automatically passing the password to the server::
273 pithos-storage.dev.grnet.gr:5432:pithos:pithos:password
277 psql -h pithos-storage.dev.grnet.gr -U pithos