Install packages::
apt-get install git python-django python-setuptools python-sphinx
- apt-get install python-sqlalchemy python-psycopg2
+ apt-get install python-sqlalchemy python-mysqldb python-psycopg2
apt-get install apache2 libapache2-mod-wsgi
Get the source::
</VirtualHost>
</IfModule>
+Add in ``/etc/apache2/mods-available/wsgi.conf``::
+
+ WSGIChunkedRequest On
+
Configure and run apache::
a2enmod ssl
alias pithos-sync='cd /pithos && git pull && python setup.py build_sphinx && /etc/init.d/apache2 restart'
+Gunicorn Setup
+--------------
+
+Add in ``/etc/apt/sources.list``::
+
+ deb http://backports.debian.org/debian-backports squeeze-backports main
+
+Then::
+
+ apt-get update
+ apt-get -t squeeze-backports install gunicorn
+ apt-get -t squeeze-backports install python-gevent
+
+Create ``/etc/gunicorn.d/pithos``::
+
+ CONFIG = {
+ 'mode': 'django',
+ 'working_dir': '/pithos/pithos',
+ 'user': 'www-data',
+ 'group': 'www-data',
+ 'args': (
+ '--bind=[::]:8080',
+ '--worker-class=egg:gunicorn#gevent',
+ '--workers=4',
+ '--log-level=debug',
+ '/pithos/pithos/settings.py',
+ ),
+ }
+
+Replace the ``WSGI*`` directives in ``/etc/apache2/sites-available/pithos`` and ``/etc/apache2/sites-available/pithos-ssl`` with::
+
+ <Proxy *>
+ Order allow,deny
+ Allow from all
+ </Proxy>
+
+ SetEnv proxy-sendchunked
+ SSLProxyEngine off
+ ProxyErrorOverride off
+
+ ProxyPass /api http://localhost:8080 retry=0
+ ProxyPassReverse /api http://localhost:8080
+
+Configure and run::
+
+ /etc/init.d/gunicorn restart
+ a2enmod proxy
+ a2enmod proxy_http
+ /etc/init.d/apache2 restart
+
Shibboleth Setup
----------------
Add in ``/etc/apache2/sites-available/pithos-ssl``::
- ShibConfig /etc/shibboleth/shibboleth2.xml
- Alias /shibboleth-sp /usr/share/shibboleth
+ ShibConfig /etc/shibboleth/shibboleth2.xml
+ Alias /shibboleth-sp /usr/share/shibboleth
- <Location /api/login>
- AuthType shibboleth
- ShibRequireSession On
- ShibUseHeaders On
- require valid-user
- </Location>
+ <Location /api/login>
+ AuthType shibboleth
+ ShibRequireSession On
+ ShibUseHeaders On
+ require valid-user
+ </Location>
Configure and run apache::
/etc/init.d/apache2 restart
/etc/init.d/shibd restart
+The following tokens should be available at the destination, after passing through the apache module::
+
+ eppn # eduPersonPrincipalName
+ Shib-InetOrgPerson-givenName
+ Shib-Person-surname
+ Shib-Person-commonName
+ Shib-InetOrgPerson-displayName
+ Shib-EP-Affiliation
+ Shib-Session-ID
+
MySQL Setup
-----------
apt-get install mysql-server
+Add in ``/etc/mysql/conf.d/pithos.cnf``::
+
+ [mysqld]
+ sql-mode="NO_AUTO_VALUE_ON_ZERO"
+
Edit ``/etc/mysql/my.cnf`` to allow network connections and restart the server.
Create database and user::
- CREATE DATABASE pithos;
+ CREATE DATABASE pithos CHARACTER SET utf8 COLLATE utf8_bin;
GRANT ALL ON pithos.* TO pithos@localhost IDENTIFIED BY 'password';
GRANT ALL ON pithos.* TO pithos@'%' IDENTIFIED BY 'password';