@echo " $(MAKE) MYSLICEBOX=debian04.pl.sophia.inria.fr "$@""
@exit 1
else
- +$(RSYNC) ./apache/myslice.conf $(SSHURL)/$(INSTALLED_APACHE)/
+ +$(RSYNC) ./apache/unfold.conf $(SSHURL)/$(INSTALLED_APACHE)/
+$(RSYNC) ./apache/unfold-init-ssl.sh $(SSHURL)/$(bindir)/
endif
-# xxx it might be smarter to install wsgi.py in some other location
-# so we don't have to hard-wire these paths here
-# xxx it might also be helpful to set up a specific log channel for this
-# e.g. in /var/log/myslice.log
<VirtualHost *:80>
- WSGIDaemonProcess myslice processes=2 threads=25
- WSGIProcessGroup myslice
- CustomLog ${APACHE_LOG_DIR}/myslice-access.log common
- ErrorLog ${APACHE_LOG_DIR}/myslice-error.log
- WSGIScriptAlias / /usr/lib/python2.7/dist-packages/myslice/wsgi.py
- <Directory /usr/share/unfold/myslice>
- <Files wsgi.py>
+ WSGIDaemonProcess unfold processes=2 threads=25
+ WSGIProcessGroup unfold
+ CustomLog ${APACHE_LOG_DIR}/unfold-access.log common
+ ErrorLog ${APACHE_LOG_DIR}/unfold-error.log
+ WSGIScriptAlias / /usr/share/unfold/apache/unfold.wsgi
+ <Directory /usr/share/unfold/apache/>
+ <Files unfold.wsgi>
Order deny,allow
Allow from all
</Files>
WSGIProcessGroup myslice-ssl
CustomLog ${APACHE_LOG_DIR}/myslice-ssl-access.log common
ErrorLog ${APACHE_LOG_DIR}/myslice-ssl-error.log
- WSGIScriptAlias / /usr/lib/python2.7/dist-packages/myslice/wsgi.py
- <Directory /usr/share/unfold/apache>
- <Files myslice.wsgi>
+ WSGIScriptAlias / /usr/share/unfold/apache/unfold.wsgi
+ <Directory /usr/share/unfold/apache/>
+ <Files unfold.wsgi>
Order deny,allow
Allow from all
</Files>
usr/lib*/python*/dist-packages/sample
usr/share/unfold/static
usr/share/unfold/templates
+apache/unfold.wsgi /usr/share/unfold/apache/
+apache/unfold.conf /etc/apache2/sites-available
manage.py usr/share/unfold/
-apache/myslice.conf /etc/apache2/sites-available
+usr/bin/unfold-init-ssl.sh
#!/bin/bash
# if this requires a service to be running, add something like this
# update-rc.d unfold defaults
+[ -d /var/unfold ] || mkdir /var/unfold
+chown -R www-data.www-data /var/unfold
/usr/share/unfold/manage.py syncdb
/usr/share/unfold/manage.py migrate
-chmod 777 /usr/share/unfold/myslice.sqlite3
-chmod 777 /usr/share/unfold
+chmod 700 /var/unfold/unfold.sqlite3
a2dissite default
-a2ensite myslice.conf
+a2ensite unfold.conf
service apache2 restart
-# Django settings for myslice project.
+# Django settings for unfold project.
import os.path
import traceback
traceback.print_exc()
-# find out DATAROOT, which is different from ROOT
+# find out HTTPROOT, which is different from ROOT
# when deployed from a package
# this code is run by collectstatic too, so we cannot
# assume we have ./static present already
-DATAROOT="/usr/share/unfold"
+HTTPROOT="/usr/share/unfold"
+# the place to store local data, like e.g. the sqlite db
+DATAROOT="/var/unfold"
# if not there, then we assume it's from a devel tree
-if not os.path.isdir (os.path.join(DATAROOT,"static")):
+if not os.path.isdir (os.path.join(HTTPROOT,"static")):
+ HTTPROOT=ROOT
DATAROOT=ROOT
-if not os.path.isdir(ROOT): raise Exception,"Cannot find ROOT %s for myslice"%ROOT
-if not os.path.isdir(DATAROOT): raise Exception,"Cannot find DATAROOT %s for myslice"%DATAROOT
+if not os.path.isdir(ROOT): raise Exception,"Cannot find ROOT %s for unfold"%ROOT
+if not os.path.isdir(HTTPROOT): raise Exception,"Cannot find HTTPROOT %s for unfold"%HTTPROOT
####################
ADMINS = (
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
- 'NAME': os.path.join(DATAROOT,'myslice.sqlite3'), # Or path to database file if using sqlite3.
+ 'NAME': os.path.join(DATAROOT,'unfold.sqlite3'), # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
-STATIC_ROOT = os.path.join(DATAROOT,'static')
+STATIC_ROOT = os.path.join(HTTPROOT,'static')
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
ROOT_URLCONF = 'myslice.urls'
# Python dotted path to the WSGI application used by Django's runserver.
-WSGI_APPLICATION = 'myslice.wsgi.application'
+WSGI_APPLICATION = 'unfold.wsgi.application'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
- os.path.join(DATAROOT,"templates"),
+ os.path.join(HTTPROOT,"templates"),
)
INSTALLED_APPS = (
#!/usr/bin/python
#
-# Setup script for myslice
+# Setup script for myslice+unfold
#
# Thierry Parmentelat <thierry.parmentelat@inria.fr>
# INRIA (c) 2013
( '/usr/share/unfold/static/img', glob ('static/img/*')),
( '/usr/share/unfold/static/fonts', glob ('static/fonts/*')),
( '/usr/share/unfold/templates', glob ('templates/*')),
- ( 'apache', [ 'apache/myslice.conf' ]),
+ ( 'apache', [ 'apache/unfold.conf', 'apache/unfold.wsgi' ]),
])