manager-apache2.conf 3.08 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
50

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

54
    DocumentRoot __MANAGERSITEDIR__
55 56

    <Location />
57
        Order Deny,Allow
Xavier Guimard's avatar
Xavier Guimard committed
58
       Allow from all
59 60 61 62 63 64 65 66 67 68 69 70 71

        <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

73
    # Static files (javascripts, HTML forms,...)
Xavier Guimard's avatar
Xavier Guimard committed
74 75

    Alias /static/ __MANAGERSTATICDIR__/
76
    <Directory __MANAGERSTATICDIR__>
Xavier Guimard's avatar
Xavier Guimard committed
77 78
        Order deny,allow
        Allow from all
79 80
        Options +FollowSymLinks
    </Directory>
81 82

    # On-line documentation
83
    Alias /doc/ __DEFDOCDIR__
84
    Alias /lib/ __DEFDOCDIR__pages/documentation/current/lib/
85
    <Directory __DEFDOCDIR__>
Xavier Guimard's avatar
Xavier Guimard committed
86
        Order allow,deny
Xavier Guimard's avatar
Xavier Guimard committed
87 88 89
        Allow from all
        ErrorDocument 404 /notfound.html
        Options +FollowSymLinks
90
        DirectoryIndex index.html start.html
91 92
    </Directory>

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