aboutsummaryrefslogtreecommitdiffstats
path: root/APACHE2_skaschool.conf
blob: 29902fb734aaf452ef32e31762163aba643d1e6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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>