portal-apache2.conf 3 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
#====================================================================
# Apache configuration for LemonLDAP::NG Portal
#====================================================================

# Uncomment this if no previous NameVirtualHost declaration
#NameVirtualHost __VHOSTLISTEN__

# Portal Virtual Host (auth.__DNSDOMAIN__)
<VirtualHost __VHOSTLISTEN__>
    ServerName auth.__DNSDOMAIN__

Yadd's avatar
Yadd committed
12
    # DocumentRoot (FCGI scripts)
Yadd's avatar
Yadd committed
13
14
    DocumentRoot __PORTALSITEDIR__
    <Directory __PORTALSITEDIR__>
Yadd's avatar
Yadd committed
15
16
17
        Order allow,deny
        Allow from all
        Options +ExecCGI +FollowSymLinks
18
    </Directory>
Yadd's avatar
Yadd committed
19
    RewriteEngine On
Yadd's avatar
Yadd committed
20
21
22
23
    # For performances, you can put static html files: simply put the HTML
    # result (example: /oauth2/checksession.html) as static file. Then
    # uncomment the following line.
    # RewriteCond "%{REQUEST_FILENAME}" "!\.html$"
Yadd's avatar
Yadd committed
24
25
    RewriteCond "%{REQUEST_FILENAME}" "!^/(?:(?:static|javascript|favicon).*|.*\.fcgi)$"
    RewriteRule "^/(.+)$" "/index.fcgi/$1" [PT]
26

Yadd's avatar
Yadd committed
27
    # Note that Content-Security-Policy header is generated by portal itself
Yadd's avatar
Yadd committed
28
    <Files *.fcgi>
Yadd's avatar
Yadd committed
29
        SetHandler fcgid-script
30
31
        #CGIPassAuth on
        Options +ExecCGI
Yadd's avatar
Yadd committed
32
33
    </Files>

Yadd's avatar
Yadd committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
    # Static files
    Alias /static/ __PORTALSTATICDIR__/
    <Directory __PORTALSTATICDIR__>
        Order allow,deny
        Allow from all
        Options +FollowSymLinks
    </Directory>
    <Location /static/>
        <IfModule mod_expires.c>
            ExpiresActive On
            ExpiresDefault "access plus 1 month"
        </IfModule>
    </Location>

48
    <IfModule mod_dir.c>
Yadd's avatar
Yadd committed
49
        DirectoryIndex index.fcgi index.html
50
51
    </IfModule>

52
    # REST/SOAP functions for sessions management (disabled by default)
Yadd's avatar
Yadd committed
53
    <Location /index.fcgi/adminSessions>
Yadd's avatar
Yadd committed
54
55
        Order deny,allow
        Deny from all
56
    </Location>
57

58
    # REST/SOAP functions for sessions access (disabled by default)
Yadd's avatar
Yadd committed
59
    <Location /index.fcgi/sessions>
Yadd's avatar
Yadd committed
60
61
        Order deny,allow
        Deny from all
62
    </Location>
63

64
    # REST/SOAP functions for configuration access (disabled by default)
Yadd's avatar
Yadd committed
65
    <Location /index.fcgi/config>
Yadd's avatar
Yadd committed
66
67
        Order deny,allow
        Deny from all
68
    </Location>
69

70
    # REST/SOAP functions for notification insertion (disabled by default)
Yadd's avatar
Yadd committed
71
    <Location /index.fcgi/notification>
Yadd's avatar
Yadd committed
72
73
        Order deny,allow
        Deny from all
74
    </Location>
75

Yadd's avatar
Yadd committed
76
    # Enabe compression
Yadd's avatar
Yadd committed
77
78
    <Location />
        <IfModule mod_deflate.c>
Yadd's avatar
Yadd committed
79
80
81
82
83
84
                AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css
                SetOutputFilter DEFLATE
                BrowserMatch ^Mozilla/4 gzip-only-text/html
                BrowserMatch ^Mozilla/4\.0[678] no-gzip
                BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
                SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
Yadd's avatar
Yadd committed
85
86
        </IfModule>
        <IfModule mod_headers.c>
Yadd's avatar
Yadd committed
87
                Header append Vary User-Agent env=!dont-vary
Yadd's avatar
Yadd committed
88
89
        </IfModule>
    </Location>
Yadd's avatar
Yadd committed
90
91
92

    # Uncomment this if site if you use SSL only
    #Header set Strict-Transport-Security 15768000
93
94
</VirtualHost>