summaryrefslogtreecommitdiff
path: root/htetc/freeside-base2.4.conf
blob: d6ff4f7035865273df9612ad39a08658de606047 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
PerlModule Apache2::compat

#PerlModule DBIx::Profile
#PerlModule Apache::DBI

PerlModule HTML::Mason
PerlSetVar MasonArgsMethod CGI
PerlModule HTML::Mason::ApacheHandler

PerlRequire "%%%MASON_HANDLER%%%"

PerlChildInitHandler FS::Mason::child_init

#Locale::SubCountry
AddDefaultCharset UTF-8

PerlModule FS::AuthCookieHandler24
PerlAddAuthzProvider user FS::AuthCookieHandler24->authz_handler

#XXX need to also work properly for installs w/o /freeside/ in path
PerlSetVar FreesideLoginScript /freeside/loginout/login.html

#disables HTTP, so HTTPS only
#PerlSetVar FreesideSecure 1

#prevents cookie theft via JS
PerlSetVar FreesideHttpOnly 1

#prevents broken restarts with "couldn't grab the accept mutex" error
Mutex posixsem

<Directory %%%FREESIDE_DOCUMENT_ROOT%%%>

    #work around Apache2::AuthCookie vs. mod_dir
    DirectoryIndex disabled
    Options -Indexes
    #XXX need to also work properly for installs w/o /freeside/ in path
    RewriteEngine On
    RewriteBase /freeside/
    RewriteRule ^/?$ /freeside/index.html [L,R=301]

    AuthName Freeside
    AuthType FS::AuthCookieHandler24
    PerlAuthenHandler FS::AuthCookieHandler24->authenticate
    require valid-user

    <Files ~ "(\.cgi|\.html)$">
        SetHandler perl-script
        PerlHandler HTML::Mason
    </Files>

</Directory>

<Files login>
    AuthName Freeside
    AuthType FS::AuthCookieHandler24
    SetHandler perl-script
    PerlHandler FS::AuthCookieHandler24->login
</Files>

<Directory %%%FREESIDE_DOCUMENT_ROOT%%%/loginout/>
    <Files "login.html">
        Satisfy any
    </Files>
</Directory>

<Directory %%%FREESIDE_DOCUMENT_ROOT%%%/elements/>
    <Files "freeside.css">
        Satisfy any
    </Files>

    <Files ~ "(\.html)$">
        Deny from all
        SetHandler None
    </Files>
</Directory>

<Directory %%%FREESIDE_DOCUMENT_ROOT%%%/rt/Helpers/>
    SetHandler perl-script
    PerlHandler HTML::Mason
</Directory>

<Directory %%%FREESIDE_DOCUMENT_ROOT%%%/rt/REST/1.0/NoAuth/>
    Satisfy any
</Directory>

<Directory %%%FREESIDE_DOCUMENT_ROOT%%%/rt/NoAuth/iCal/>
    Satisfy any
    SetHandler perl-script
    PerlHandler HTML::Mason
</Directory>

<Directory %%%FREESIDE_DOCUMENT_ROOT%%%/REST/>
    Satisfy any
    SetHandler perl-script
    PerlHandler HTML::Mason
</Directory>