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'
132 apt-get install libapache2-mod-shib2
134 Setup the files in ``/etc/shibboleth``.
136 Add in ``/etc/apache2/sites-available/pithos-ssl``::
138 ShibConfig /etc/shibboleth/shibboleth2.xml
139 Alias /shibboleth-sp /usr/share/shibboleth
141 <Location /api/login>
143 ShibRequireSession On
148 Configure and run apache::
151 /etc/init.d/apache2 restart
152 /etc/init.d/shibd restart
154 The following tokens should be available at the destination, after passing through the apache module::
156 SHIB_EPPN = "eppn" # eduPersonPrincipalName
157 SHIB_NAME = "Shib-InetOrgPerson-givenName"
158 SHIB_SURNAME = "Shib-Person-surname"
159 SHIB_CN = "Shib-Person-commonName"
160 SHIB_DISPLAYNAME = "Shib-InetOrgPerson-displayName"
161 SHIB_EP_AFFILIATION = "Shib-EP-Affiliation"
162 SHIB_SESSION_ID = "Shib-Session-ID"
167 If using MySQL instead of SQLite for the database engine, consider the following.
171 apt-get install mysql-server
173 Add in ``/etc/mysql/conf.d/pithos.cnf``::
176 sql-mode="NO_AUTO_VALUE_ON_ZERO"
178 Edit ``/etc/mysql/my.cnf`` to allow network connections and restart the server.
180 Create database and user::
182 CREATE DATABASE pithos CHARACTER SET utf8 COLLATE utf8_bin;
183 GRANT ALL ON pithos.* TO pithos@localhost IDENTIFIED BY 'password';
184 GRANT ALL ON pithos.* TO pithos@'%' IDENTIFIED BY 'password';
188 apt-get install mysql-client
190 It helps to create a ``~/.my.cnf`` file, for automatically connecting to the server::
194 password = 'password'
195 host = pithos-storage.dev.grnet.gr
203 If using PostgreSQL instead of SQLite for the database engine, consider the following.
207 apt-get install postgresql
209 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.
211 Create database and user::
213 CREATE DATABASE pithos WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0;
214 CREATE USER pithos WITH PASSWORD 'password';
215 GRANT ALL PRIVILEGES ON DATABASE pithos TO pithos;
219 apt-get install postgresql-client
221 It helps to create a ``~/.pgpass`` file, for automatically passing the password to the server::
223 pithos-storage.dev.grnet.gr:5432:pithos:pithos:password
227 psql -h pithos-storage.dev.grnet.gr -U pithos