manager-apache2.4.conf 3.03 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
Xavier Guimard's avatar
Xavier Guimard committed
17
    #CustomLog ${APACHE_LOG_DIR}/manager.log llng
18
    #ErrorLog ${APACHE_LOG_DIR}/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
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
50

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

54
    DocumentRoot __MANAGERSITEDIR__
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71

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

    Alias /static/ __MANAGERSTATICDIR__/
75
    <Directory __MANAGERSTATICDIR__>
76
        Require all granted
77 78
        Options +FollowSymLinks
    </Directory>
79 80

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

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