portal-apache2.conf 2.64 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 20 21
    RewriteEngine On
    RewriteCond "%{REQUEST_FILENAME}" "!^/(?:(?:static|javascript|favicon).*|.*\.fcgi)$"
    RewriteRule "^/(.+)$" "/index.fcgi/$1" [PT]
22

23
    <Files *.fcgi>
Xavier Guimard's avatar
Xavier Guimard committed
24 25 26 27
        SetHandler fcgid-script
	Options +ExecCGI
    </Files>

28 29 30 31 32 33 34 35 36 37 38 39 40 41
    # 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>

42
    <IfModule mod_dir.c>
43
        DirectoryIndex index.fcgi index.html
44 45 46
    </IfModule>

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

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

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

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

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

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