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 Make sure the data folder is writable by the web server user::
117 chown -R www-data:www-data /pithos/pithos/data
119 If using an SQLite database, the same goes for the database file and the containing folder::
121 chown www-data:www-data /pithos/pithos/
122 chown www-data:www-data /pithos/pithos/backend.db
124 Configure and run apache::
131 mkdir /var/www/pithos
132 mkdir /var/www/pithos_web_client
133 /etc/init.d/apache2 restart
135 Useful alias to add in ``~/.bashrc``::
137 alias sync-pithos='cd /pithos && git pull && python setup.py build_sphinx && /etc/init.d/apache2 restart'
142 Add in ``/etc/apt/sources.list``::
144 deb http://backports.debian.org/debian-backports squeeze-backports main
149 apt-get -t squeeze-backports install gunicorn
150 apt-get -t squeeze-backports install python-gevent
152 Create ``/etc/gunicorn.d/pithos``::
156 'working_dir': '/pithos/pithos',
161 '--worker-class=egg:gunicorn#gevent',
164 '/pithos/pithos/settings.py',
168 Replace the ``WSGI*`` directives in ``/etc/apache2/sites-available/pithos`` and ``/etc/apache2/sites-available/pithos-ssl`` with::
175 SetEnv proxy-sendchunked
177 ProxyErrorOverride off
179 ProxyPass /api http://localhost:8080 retry=0
180 ProxyPassReverse /api http://localhost:8080
182 Make sure that in ``settings.local``::
184 USE_X_FORWARDED_HOST = True
188 /etc/init.d/gunicorn restart
191 /etc/init.d/apache2 restart
193 If experiencing timeout problems, try adding to ``/etc/gunicorn.d/pithos``::
204 apt-get install libapache2-mod-shib2
206 Setup the files in ``/etc/shibboleth``.
208 Add in ``/etc/apache2/sites-available/pithos-ssl``::
210 ShibConfig /etc/shibboleth/shibboleth2.xml
211 Alias /shibboleth-sp /usr/share/shibboleth
213 <Location /api/im/login/shibboleth>
215 ShibRequireSession On
220 Configure and run apache::
223 /etc/init.d/apache2 restart
224 /etc/init.d/shibd restart
226 The following tokens should be available at the destination, after passing through the apache module::
228 eppn # eduPersonPrincipalName
229 Shib-InetOrgPerson-givenName
231 Shib-Person-commonName
232 Shib-InetOrgPerson-displayName
239 If using MySQL instead of SQLite for the database engine, consider the following.
243 apt-get install mysql-server
245 Add in ``/etc/mysql/conf.d/pithos.cnf``::
248 sql-mode="NO_AUTO_VALUE_ON_ZERO"
250 Edit ``/etc/mysql/my.cnf`` to allow network connections and restart the server.
252 Create database and user::
254 CREATE DATABASE pithos CHARACTER SET utf8 COLLATE utf8_bin;
255 GRANT ALL ON pithos.* TO pithos@localhost IDENTIFIED BY 'password';
256 GRANT ALL ON pithos.* TO pithos@'%' IDENTIFIED BY 'password';
260 apt-get install mysql-client
262 It helps to create a ``~/.my.cnf`` file, for automatically connecting to the server::
266 password = 'password'
267 host = pithos-storage.dev.grnet.gr
275 If using PostgreSQL instead of SQLite for the database engine, consider the following.
279 apt-get install postgresql
281 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.
283 Create database and user::
285 CREATE DATABASE pithos WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0;
286 CREATE USER pithos WITH PASSWORD 'password';
287 GRANT ALL PRIVILEGES ON DATABASE pithos TO pithos;
291 apt-get install postgresql-client
293 It helps to create a ``~/.pgpass`` file, for automatically passing the password to the server::
295 pithos-storage.dev.grnet.gr:5432:pithos:pithos:password
299 psql -h pithos-storage.dev.grnet.gr -U pithos