Install packages::
- apt-get install git python-django python-setuptools python-sphinx python-httplib2
+ apt-get install git python-django python-setuptools python-sphinx
apt-get install python-sqlalchemy python-mysqldb python-psycopg2
apt-get install apache2 libapache2-mod-wsgi
cd /
git clone https://code.grnet.gr/git/pithos
-Setup the files (choose where to store data in ``settings.py`` and change ``SECRET_KEY``)::
+Setup the files::
cd /pithos/pithos
- cp settings.py.dist settings.py
python manage.py syncdb
cd /pithos
python setup.py build_sphinx
+It is advised that you create a ``settings.local`` file to place any configuration overrides (at least change ``SECRET_KEY``).
+
Edit ``/etc/apache2/sites-available/pithos`` (change the ``ServerName`` directive)::
<VirtualHost *:80>
Allow from all
</Directory>
+ SetEnv no-gzip
+ SetEnv dont-vary
+
RewriteEngine On
RewriteRule ^/v(.*) /api/v$1 [PT,NE]
RewriteRule ^/public(.*) /api/public$1 [PT,NE]
RewriteRule ^/im(.*) https://%{HTTP_HOST}%{REQUEST_URI} [NE]
RewriteRule ^/login(.*) https://%{HTTP_HOST}%{REQUEST_URI} [NE]
+ RequestHeader set X-Forwarded-Protocol "http"
+
WSGIScriptAlias /api /pithos/pithos/wsgi/pithos.wsgi
# WSGIDaemonProcess pithos
# WSGIProcessGroup pithos
Allow from all
</Directory>
+ SetEnv no-gzip
+ SetEnv dont-vary
+
RewriteEngine On
RewriteRule ^/v(.*) /api/v$1 [PT,NE]
RewriteRule ^/public(.*) /api/public$1 [PT,NE]
RewriteRule ^/im(.*) /api/im$1 [PT,NE]
RewriteRule ^/login(.*) /api/im/login/dummy$1 [PT,NE]
+ RequestHeader set X-Forwarded-Protocol "https"
+
WSGIScriptAlias /api /pithos/pithos/wsgi/pithos.wsgi
# WSGIDaemonProcess pithos
# WSGIProcessGroup pithos
Useful alias to add in ``~/.bashrc``::
- alias pithos-sync='cd /pithos && git pull && python setup.py build_sphinx && /etc/init.d/apache2 restart'
+ alias sync-pithos='cd /pithos && git pull && python setup.py build_sphinx && /etc/init.d/apache2 restart'
Gunicorn Setup
--------------
ProxyPass /api http://localhost:8080 retry=0
ProxyPassReverse /api http://localhost:8080
+Make sure that in ``settings.local``::
+
+ USE_X_FORWARDED_HOST = True
+
Configure and run::
/etc/init.d/gunicorn restart
a2enmod proxy_http
/etc/init.d/apache2 restart
+If experiencing timeout problems, try adding to ``/etc/gunicorn.d/pithos``::
+
+ ...
+ '--timeout=43200',
+ ...
+
Shibboleth Setup
----------------