manager-apache2.4.conf 2.93 KB
Newer Older
1 2 3 4
#====================================================================
# Apache configuration for LemonLDAP::NG Manager
#====================================================================

5 6 7 8
# 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

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

17 18 19 20
    # FASTCGI CONFIGURATION
    # ---------------------

    # 1) URI management
21
    RewriteEngine on
22 23 24 25 26 27 28 29 30

    # 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
31
    RewriteCond "%{REQUEST_FILENAME}" "!^/(?:static|doc|lib|javascript|favicon).*"
32
    RewriteRule "^/(.+)$" "/manager.fcgi/$1" [PT]
33 34 35 36 37

    # 2) FastCGI engine

    # You can choose any FastCGI system. Here is an example using mod_fcgid
    # mod_fcgid configuration
38
    FcgidMaxRequestLen 2000000
39
    <Files *.fcgi>
40 41
        SetHandler fcgid-script
        Options +ExecCGI
42
        header unset Lm-Remote-User
43
    </Files>
44

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

48 49 50
    # GLOBAL CONFIGURATION
    # --------------------

51
    DocumentRoot __MANAGERSITEDIR__
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68

    <Location />
        Require all granted

        <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>
    
69
    # Static files (javascripts, HTML forms,...)
Xavier Guimard's avatar
Xavier Guimard committed
70 71

    Alias /static/ __MANAGERSTATICDIR__/
72
    <Directory __MANAGERSTATICDIR__>
73
        Require all granted
74 75
        Options +FollowSymLinks
    </Directory>
76 77

    # On-line documentation
78
    Alias /doc/ __DEFDOCDIR__
79
    Alias /lib/ __DEFDOCDIR__pages/documentation/current/lib/
80
    <Directory __DEFDOCDIR__>
81 82 83
        Require all granted
        ErrorDocument 404 /notfound.html
        Options +FollowSymLinks
84
        DirectoryIndex index.html start.html
85 86
    </Directory>

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