File: api-apache2.X.conf

package info (click to toggle)
lemonldap-ng 2.22.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 28,516 kB
  • sloc: perl: 82,515; javascript: 25,474; xml: 6,473; makefile: 1,327; sh: 492; sql: 159; python: 55; php: 26
file content (108 lines) | stat: -rw-r--r-- 3,670 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#====================================================================
# Apache configuration for LemonLDAP::NG Manager
#====================================================================

# Uncomment this if no previous NameVirtualHost declaration
#NameVirtualHost __VHOSTLISTEN__

# 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 %{Lm-Remote-Custom}o" llng

# Manager virtual host (manager.__DNSDOMAIN__)
<VirtualHost __VHOSTLISTEN__>
    ServerName manager-api.__DNSDOMAIN__
    LogLevel notice
    # See above to set LLNG user id in Apache logs
    #CustomLog __APACHELOGDIR__/manager-api.log llng
    #ErrorLog __APACHELOGDIR__/lm_err.log

    # Uncomment this if you are running behind a reverse proxy and want
    # LemonLDAP::NG to see the real IP address of the end user
    # Adjust the settings to match the IP address of your reverse proxy
    # and the header containing the original IP address
    #
    #RemoteIPHeader X-Forwarded-For
    #RemoteIPInternalProxy 127.0.0.1


    # FASTCGI CONFIGURATION
    # ---------------------

    # 1) URI management
    RewriteEngine on

    # 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_URI}" "!\.html(?:/.*)?$"

    # REST URLs
    RewriteCond "%{REQUEST_URI}" "!^/(?:doc)"
    RewriteRule "^/(.+)$" "/api.fcgi/$1" [PT]

    # 2) FastCGI engine

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

    # If you want to use mod_fastcgi, replace lines below by:
    #FastCgiServer __MANAGERAPIDIR__/manager.fcgi

    # GLOBAL CONFIGURATION
    # --------------------

    DocumentRoot __MANAGERAPIDIR__

    <Location />

        # By default, access to this VHost is denied
        # If you want to enable the manager APIs, you MUST
        # implement a robust authentication scheme to protect this
        # VHost since LemonLDAP::NG provides no protection to the
        # Manager APIs yet
        <IfVersion >= 2.3>
            Require all denied
        </IfVersion>
        <IfVersion < 2.3>
            Order Deny,Allow
            Deny from all
        </IfVersion>
        Options +FollowSymLinks

        <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>

    # On-line documentation
    Alias /doc/ __DEFDOCDIR__
    <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
        DirectoryIndex index.html start.html
    </Directory>
</VirtualHost>