portal-apache2.conf 2.87 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__

12
    # DocumentRoot (FCGI scripts)
13 14
    DocumentRoot __PORTALDIR__
    <Directory __PORTALDIR__>
Xavier Guimard's avatar
Xavier Guimard committed
15 16 17
        Order allow,deny
        Allow from all
        Options +ExecCGI +FollowSymLinks
18
    </Directory>
19
    RewriteEngine On
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$"
24 25
    RewriteCond "%{REQUEST_FILENAME}" "!^/(?:(?:static|javascript|favicon).*|.*\.fcgi)$"
    RewriteRule "^/(.+)$" "/index.fcgi/$1" [PT]
26

27
    <Files *.fcgi>
Xavier Guimard's avatar
Xavier Guimard committed
28 29 30 31
        SetHandler fcgid-script
	Options +ExecCGI
    </Files>

32 33 34 35 36 37 38 39 40 41 42 43 44 45
    # 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>

46
    <IfModule mod_dir.c>
47
        DirectoryIndex index.fcgi index.html
48 49 50
    </IfModule>

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

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

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

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

74
    # Enabe compression
75 76
    <Location />
        <IfModule mod_deflate.c>
Xavier Guimard's avatar
Xavier Guimard committed
77 78 79 80 81 82
                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
83 84
        </IfModule>
        <IfModule mod_headers.c>
Xavier Guimard's avatar
Xavier Guimard committed
85
                Header append Vary User-Agent env=!dont-vary
86 87
        </IfModule>
    </Location>
88 89 90

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