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
23 python manage.py syncdb
25 python setup.py build_sphinx
27 It is advised that you create a ``settings.local`` file to place any configuration overrides (at least change ``SECRET_KEY``).
29 Edit ``/etc/apache2/sites-available/pithos`` (change the ``ServerName`` directive)::
32 ServerAdmin webmaster@pithos.dev.grnet.gr
33 ServerName pithos.dev.grnet.gr
35 DocumentRoot /pithos/htdocs
36 Alias /ui "/var/www/pithos_web_client"
37 Alias /docs "/pithos/docs/build/html"
40 Options Indexes FollowSymLinks
50 RewriteRule ^/v(.*) /api/v$1 [PT,NE]
51 RewriteRule ^/public(.*) /api/public$1 [PT,NE]
52 RewriteRule ^/tools(.*) /api/ui$1 [PT,NE]
53 RewriteRule ^/im(.*) https://%{HTTP_HOST}%{REQUEST_URI} [NE]
54 RewriteRule ^/login(.*) https://%{HTTP_HOST}%{REQUEST_URI} [NE]
56 RequestHeader set X-Forwarded-Protocol "http"
58 WSGIScriptAlias /api /pithos/pithos/wsgi/pithos.wsgi
59 # WSGIDaemonProcess pithos
60 # WSGIProcessGroup pithos
63 ErrorLog ${APACHE_LOG_DIR}/pithos.error.log
64 CustomLog ${APACHE_LOG_DIR}/pithos.access.log combined
67 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)::
70 <VirtualHost _default_:443>
71 ServerAdmin webmaster@pithos.dev.grnet.gr
72 ServerName pithos.dev.grnet.gr
74 DocumentRoot /pithos/htdocs
75 Alias /ui "/var/www/pithos_web_client"
76 Alias /docs "/pithos/docs/build/html"
79 Options Indexes FollowSymLinks
89 RewriteRule ^/v(.*) /api/v$1 [PT,NE]
90 RewriteRule ^/public(.*) /api/public$1 [PT,NE]
91 RewriteRule ^/tools(.*) /api/ui$1 [PT,NE]
92 RewriteRule ^/im(.*) /api/im$1 [PT,NE]
93 RewriteRule ^/login(.*) /api/im/login/dummy$1 [PT,NE]
95 RequestHeader set X-Forwarded-Protocol "https"
97 WSGIScriptAlias /api /pithos/pithos/wsgi/pithos.wsgi
98 # WSGIDaemonProcess pithos
99 # WSGIProcessGroup pithos
102 ErrorLog ${APACHE_LOG_DIR}/pithos.error.log
103 CustomLog ${APACHE_LOG_DIR}/pithos.access.log combined
106 SSLCertificateFile /etc/ssl/certs/pithos.dev.grnet.gr.crt
107 SSLCertificateKeyFile /etc/ssl/private/pithos.dev.grnet.gr.key
111 Add in ``/etc/apache2/mods-available/wsgi.conf``::
113 WSGIChunkedRequest On
115 Configure and run apache::
122 mkdir /var/www/pithos
123 mkdir /var/www/pithos_web_client
124 /etc/init.d/apache2 restart
126 Useful alias to add in ``~/.bashrc``::
128 alias sync-pithos='cd /pithos && git pull && python setup.py build_sphinx && /etc/init.d/apache2 restart'
133 Add in ``/etc/apt/sources.list``::
135 deb http://backports.debian.org/debian-backports squeeze-backports main
140 apt-get -t squeeze-backports install gunicorn
141 apt-get -t squeeze-backports install python-gevent
143 Create ``/etc/gunicorn.d/pithos``::
147 'working_dir': '/pithos/pithos',
152 '--worker-class=egg:gunicorn#gevent',
155 '/pithos/pithos/settings.py',
159 Replace the ``WSGI*`` directives in ``/etc/apache2/sites-available/pithos`` and ``/etc/apache2/sites-available/pithos-ssl`` with::
166 SetEnv proxy-sendchunked
168 ProxyErrorOverride off
170 ProxyPass /api http://localhost:8080 retry=0
171 ProxyPassReverse /api http://localhost:8080
173 Make sure that in ``settings.local``::
175 USE_X_FORWARDED_HOST = True
179 /etc/init.d/gunicorn restart
182 /etc/init.d/apache2 restart
184 If experiencing timeout problems, try adding to ``/etc/gunicorn.d/pithos``::
195 apt-get install libapache2-mod-shib2
197 Setup the files in ``/etc/shibboleth``.
199 Add in ``/etc/apache2/sites-available/pithos-ssl``::
201 ShibConfig /etc/shibboleth/shibboleth2.xml
202 Alias /shibboleth-sp /usr/share/shibboleth
204 <Location /api/im/login/shibboleth>
206 ShibRequireSession On
211 Configure and run apache::
214 /etc/init.d/apache2 restart
215 /etc/init.d/shibd restart
217 The following tokens should be available at the destination, after passing through the apache module::
219 eppn # eduPersonPrincipalName
220 Shib-InetOrgPerson-givenName
222 Shib-Person-commonName
223 Shib-InetOrgPerson-displayName
230 If using MySQL instead of SQLite for the database engine, consider the following.
234 apt-get install mysql-server
236 Add in ``/etc/mysql/conf.d/pithos.cnf``::
239 sql-mode="NO_AUTO_VALUE_ON_ZERO"
241 Edit ``/etc/mysql/my.cnf`` to allow network connections and restart the server.
243 Create database and user::
245 CREATE DATABASE pithos CHARACTER SET utf8 COLLATE utf8_bin;
246 GRANT ALL ON pithos.* TO pithos@localhost IDENTIFIED BY 'password';
247 GRANT ALL ON pithos.* TO pithos@'%' IDENTIFIED BY 'password';
251 apt-get install mysql-client
253 It helps to create a ``~/.my.cnf`` file, for automatically connecting to the server::
257 password = 'password'
258 host = pithos-storage.dev.grnet.gr
266 If using PostgreSQL instead of SQLite for the database engine, consider the following.
270 apt-get install postgresql
272 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.
274 Create database and user::
276 CREATE DATABASE pithos WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0;
277 CREATE USER pithos WITH PASSWORD 'password';
278 GRANT ALL PRIVILEGES ON DATABASE pithos TO pithos;
282 apt-get install postgresql-client
284 It helps to create a ``~/.pgpass`` file, for automatically passing the password to the server::
286 pithos-storage.dev.grnet.gr:5432:pithos:pithos:password
290 psql -h pithos-storage.dev.grnet.gr -U pithos