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-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 Configure and run apache::
115 mkdir /var/www/pithos
116 mkdir /var/www/pithos_web_client
117 /etc/init.d/apache2 restart
119 Useful alias to add in ``~/.bashrc``::
121 alias pithos-sync='cd /pithos && git pull && python setup.py build_sphinx && /etc/init.d/apache2 restart'
128 apt-get install libapache2-mod-shib2
130 Setup the files in ``/etc/shibboleth``.
132 Add in ``/etc/apache2/sites-available/pithos-ssl``::
134 ShibConfig /etc/shibboleth/shibboleth2.xml
135 Alias /shibboleth-sp /usr/share/shibboleth
137 <Location /api/login>
139 ShibRequireSession On
144 Configure and run apache::
147 /etc/init.d/apache2 restart
148 /etc/init.d/shibd restart
153 If using MySQL instead of SQLite for the database engine, consider the following.
157 apt-get install mysql-server
159 Edit ``/etc/mysql/my.cnf`` to allow network connections and restart the server.
161 Create database and user::
163 CREATE DATABASE pithos;
164 GRANT ALL ON pithos.* TO pithos@localhost IDENTIFIED BY 'password';
165 GRANT ALL ON pithos.* TO pithos@'%' IDENTIFIED BY 'password';
169 apt-get install mysql-client
171 It helps to create a ``~/.my.cnf`` file, for automatically connecting to the server::
175 password = 'password'
176 host = pithos-storage.dev.grnet.gr
184 If using PostgreSQL instead of SQLite for the database engine, consider the following.
188 apt-get install postgresql
190 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.
192 Create database and user::
194 CREATE DATABASE pithos WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0;
195 CREATE USER pithos WITH PASSWORD 'password';
196 GRANT ALL PRIVILEGES ON DATABASE pithos TO pithos;
200 apt-get install postgresql-client
202 It helps to create a ``~/.pgpass`` file, for automatically passing the password to the server::
204 pithos-storage.dev.grnet.gr:5432:pithos:pithos:password
208 psql -h pithos-storage.dev.grnet.gr -U pithos