manager-apache2.X.conf 3.51 KB
Newer Older
1 2 3 4 5 6 7
#====================================================================
# Apache configuration for LemonLDAP::NG Manager
#====================================================================

# Uncomment this if no previous NameVirtualHost declaration
#NameVirtualHost __VHOSTLISTEN__

8 9 10 11
# To insert LLNG user id in Apache logs, declare this format and use it in
# CustomLog directive
#LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O" llng

12 13 14
# Manager virtual host (manager.__DNSDOMAIN__)
<VirtualHost __VHOSTLISTEN__>
    ServerName manager.__DNSDOMAIN__
15
    LogLevel notice
16
    # See above to set LLNG user id in Apache logs
17 18
    #CustomLog __APACHELOGDIR__/manager.log llng
    #ErrorLog __APACHELOGDIR__/lm_err.log
19

20 21 22 23
    # FASTCGI CONFIGURATION
    # ---------------------

    # 1) URI management
24
    RewriteEngine on
25 26 27 28 29 30 31 32 33

    # For performances, you can delete the previous RewriteRule line after
    # puttings html files: simply put the HTML results of differents modules
    # (configuration, sessions, notifications) as manager.html, sessions.html,
    # notifications.html and uncomment the 2 following lines:
    # DirectoryIndex manager.html
    # RewriteCond "%{REQUEST_FILENAME}" "!\.html$"

    # REST URLs
34
    RewriteCond "%{REQUEST_FILENAME}" "!^/(?:static|doc|lib|javascript|favicon).*"
35
    RewriteRule "^/(.+)$" "/manager.fcgi/$1" [PT]
36 37 38 39 40

    # 2) FastCGI engine

    # You can choose any FastCGI system. Here is an example using mod_fcgid
    # mod_fcgid configuration
Xavier Guimard's avatar
Xavier Guimard committed
41
    FcgidMaxRequestLen 2000000
42
    <Files *.fcgi>
43 44
        SetHandler fcgid-script
        Options +ExecCGI
45
        header unset Lm-Remote-User
46
    </Files>
47

Xavier Guimard's avatar
Xavier Guimard committed
48
    # If you want to use mod_fastcgi, replace lines below by:
49
    #FastCgiServer __MANAGERSITEDIR__/manager.fcgi
Xavier Guimard's avatar
Xavier Guimard committed
50

51 52 53
    # GLOBAL CONFIGURATION
    # --------------------

54
    DocumentRoot __MANAGERSITEDIR__
55 56

    <Location />
57 58 59 60 61 62 63 64
        <IfVersion >= 2.3>
            Require all granted
        </IfVersion>
        <IfVersion < 2.3>
            Order Deny,Allow
            Allow from all
        </IfVersion>
        Options +FollowSymLinks
65 66 67 68 69 70 71 72 73 74 75 76 77

        <IfModule mod_deflate.c>
            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
        </IfModule>
        <IfModule mod_headers.c>
            Header append Vary User-Agent env=!dont-vary
        </IfModule>
    </Location>
78

79
    # Static files (javascripts, HTML forms,...)
Xavier Guimard's avatar
Xavier Guimard committed
80 81

    Alias /static/ __MANAGERSTATICDIR__/
82
    <Directory __MANAGERSTATICDIR__>
83 84 85 86 87 88 89
        <IfVersion >= 2.3>
            Require all granted
        </IfVersion>
        <IfVersion < 2.3>
            Order Deny,Allow
            Allow from all
        </IfVersion>
90 91
        Options +FollowSymLinks
    </Directory>
92 93 94

    # On-line documentation
    Alias /doc/ __DEFDOCDIR__
95
    Alias /lib/ __DEFDOCDIR__pages/documentation/current/lib/
96 97 98 99 100 101 102 103 104 105
    <Directory __DEFDOCDIR__>
        <IfVersion >= 2.3>
            Require all granted
        </IfVersion>
        <IfVersion < 2.3>
            Order Deny,Allow
            Allow from all
        </IfVersion>
        ErrorDocument 404 /notfound.html
        Options +FollowSymLinks
106
        DirectoryIndex index.html start.html
107 108
    </Directory>

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