Install packages::
- apt-get install git python-django python-django-south 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 /pithos/pithos
python manage.py syncdb
- python manage.py schemamigration im --initial
cd /pithos
python setup.py build_sphinx
CustomLog ${APACHE_LOG_DIR}/pithos.access.log combined
</VirtualHost>
+To disable non-SSL connections, ``/etc/apache2/sites-available/pithos`` should be::
+
+ <VirtualHost *:80>
+ ServerAdmin webmaster@pithos.dev.grnet.gr
+ ServerName pithos.dev.grnet.gr
+
+ RewriteEngine On
+ RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
+ </VirtualHost>
+
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)::
<IfModule mod_ssl.c>
WSGIChunkedRequest On
+Make sure the data folder is writable by the web server user::
+
+ chown -R www-data:www-data /pithos/pithos/data
+
+If using an SQLite database, the same goes for the database file and the containing folder::
+
+ chown www-data:www-data /pithos/pithos/
+ chown www-data:www-data /pithos/pithos/backend.db
+
Configure and run apache::
a2enmod ssl
Useful alias to add in ``~/.bashrc``::
- alias pithos-sync='cd /pithos && git pull && python setup.py build_sphinx && cd pithos && python manage.py migrate im && /etc/init.d/apache2 restart'
+ alias sync-pithos='cd /pithos && git pull && python setup.py build_sphinx && /etc/init.d/apache2 restart'
Gunicorn Setup
--------------