From 1c80526e14fbf32cca6ec5cc14c36046e09a4342 Mon Sep 17 00:00:00 2001 From: Weitian LI Date: Tue, 29 Apr 2014 22:58:43 +0800 Subject: * added 'DEPLOYMENT.md': notes about deployment * added 'APACHE2_skaschool.conf': configuration for apache2 (>=2.2) * renamed LICENSE to LICENSE.txt --- APACHE2_skaschool.conf | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ DEPLOYMENT.md | 41 +++++++++++++++++++++++++++++++++ LICENSE | 23 ------------------- LICENSE.txt | 23 +++++++++++++++++++ 4 files changed, 126 insertions(+), 23 deletions(-) create mode 100644 APACHE2_skaschool.conf create mode 100644 DEPLOYMENT.md delete mode 100644 LICENSE create mode 100644 LICENSE.txt 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 + + + Allow from all + Order deny,allow + + + + +## 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/ + + + Allow from all + Order deny,allow + + + + Allow from all + Order deny,allow + + +## 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 + + + AuthType Basic + AuthName "UserMeida" + AuthBasicProvider wsgi + WSGIAuthUserScript /opt/www/skaschool/django_skaschool/django_skaschool/wsgi.py + Require valid-user + + 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 CHARACTER SET utf8; +then syncdb using django manage.py: + $ python manage.py syncdb +load data if needed: + $ python manage.py loaddata + + +MEDIA_ROOT: +set write permission for MEDIA_ROOT directory (upload files) + + +Apache2 +------- +Requires version >= 2.2 (user authentication) +Configuration file: APACHE2_skaschool.conf + + diff --git a/LICENSE b/LICENSE deleted file mode 100644 index f5ba60f..0000000 --- a/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2014, Alvin Li -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..f5ba60f --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,23 @@ +Copyright (c) 2014, Alvin Li +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file -- cgit v1.2.2