diff options
author | Weitian LI <liweitianux@gmail.com> | 2014-04-29 22:58:43 +0800 |
---|---|---|
committer | Weitian LI <liweitianux@gmail.com> | 2014-04-29 22:58:43 +0800 |
commit | 1c80526e14fbf32cca6ec5cc14c36046e09a4342 (patch) | |
tree | 7be6ddf75bbab1c033f0e1fe0fe31d5e8642422e | |
parent | 96faa3b5451ca3f9d740f76c61c71ae2551f7415 (diff) | |
download | django-skaschool-1c80526e14fbf32cca6ec5cc14c36046e09a4342.tar.bz2 |
* added 'DEPLOYMENT.md': notes about deployment
* added 'APACHE2_skaschool.conf': configuration for apache2 (>=2.2)
* renamed LICENSE to LICENSE.txt
-rw-r--r-- | APACHE2_skaschool.conf | 62 | ||||
-rw-r--r-- | DEPLOYMENT.md | 41 | ||||
-rw-r--r-- | LICENSE.txt (renamed from LICENSE) | 0 |
3 files changed, 103 insertions, 0 deletions
diff --git a/APACHE2_skaschool.conf b/APACHE2_skaschool.conf new file mode 100644 index 0000000..29902fb --- /dev/null +++ b/APACHE2_skaschool.conf @@ -0,0 +1,62 @@ +### django_skaschool configuration for apache2 ### + +WSGIScriptAlias / /opt/www/skaschool/django_skaschool/django_skaschool/wsgi.py + +## embedded mode +#WSGIPythonPath /opt/www/skaschool/django_skaschool:/opt/www/skaschool/env_skaschool/lib/python2.7/site-packages + +## daemon mode +WSGIDaemonProcess skaschool python-path=/opt/www/skaschool/django_skaschool:/opt/www/skaschool/env_skaschool/lib/python2.7/site-packages +WSGIProcessGroup skaschool +WSGIApplicationGroup skaschool + +# If apache version >= 2.4: +# Require all granted +# else, also add two more lines: +# Allow from all +# Order deny,allow +<Directory /opt/www/skaschool/django_skaschool/django_skaschool> + <Files wsgi.py> + Allow from all + Order deny,allow + </Files> +</Directory> + + +## serving files + +# robots.txt and favicon.ico +Alias /robots.txt /opt/www/skaschool/static_root/robots.txt +Alias /favicon.ico /opt/www/skaschool/static_root/favicon.ico + +# css +AliasMatch ^/([^/]*\.css) /opt/www/skaschool/static_root/css/$1 + +# serving static and media files +Alias /static/ /opt/www/skaschool/static_root/ +Alias /media/ /opt/www/skaschool/media_root/ + +<Directory /opt/www/skaschool/static_root> + Allow from all + Order deny,allow +</Directory> + +<Directory /opt/www/skaschool/media_root> + Allow from all + Order deny,allow +</Directory> + +## user authentication required to access '/media/account/' +# requires apache >= 2.2 +# the wsgi script need to contain a 'check_password' function +#WSGIProcessGroup %{GLOBAL} +#WSGIApplicationGroup skaschool + +<Location /media/account> + AuthType Basic + AuthName "UserMeida" + AuthBasicProvider wsgi + WSGIAuthUserScript /opt/www/skaschool/django_skaschool/django_skaschool/wsgi.py + Require valid-user +</Location> + diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md new file mode 100644 index 0000000..774855f --- /dev/null +++ b/DEPLOYMENT.md @@ -0,0 +1,41 @@ +django_skaschool deployment +=========================== + +Installation Notes +------------------ +django 1.6: +requires python >= 2.6 +requires mod_wsgi +requires mysql >= 5.0.3 +requires MySQLdb >= 1.2.1p2 (pip mysql-python) + +mysql-python: +requires mysql_config (libmysqlclient-dev) +requires Python.h (gcc build) + +mod_wsgi: +daemon mode requires apache 2.x + + +MySQL database +-------------- +database backend settings: `PROJECT_ROOT/settings.py' + * NAME, USER, PASSWORD +create database table manually: + mysql> CREATE DATABASE <NAME> CHARACTER SET utf8; +then syncdb using django manage.py: + $ python manage.py syncdb +load data if needed: + $ python manage.py loaddata <data.json> + + +MEDIA_ROOT: +set write permission for MEDIA_ROOT directory (upload files) + + +Apache2 +------- +Requires version >= 2.2 (user authentication) +Configuration file: APACHE2_skaschool.conf + + |