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

# Uncomment this if no previous NameVirtualHost declaration
#NameVirtualHost __VHOSTLISTEN__

# Manager virtual host (manager.__DNSDOMAIN__)
<VirtualHost __VHOSTLISTEN__>
    ServerName manager.__DNSDOMAIN__
Yadd's avatar
Yadd committed
11
12
13
    LogLevel notice
    #ErrorLog ${APACHE_LOG_DIR}/lm_err.log
    #CustomLog ${APACHE_LOG_DIR}/lm.log combined
14

15
16
17
18
    # FASTCGI CONFIGURATION
    # ---------------------

    # 1) URI management
Yadd's avatar
Yadd committed
19
    RewriteEngine on
20
21
22
23
24
25
26
27
28

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

    # 2) FastCGI engine

    # You can choose any FastCGI system. Here is an example using mod_fcgid
    # mod_fcgid configuration
Yadd's avatar
Yadd committed
36
    FcgidMaxRequestLen 2000000
37
    <Files *.fcgi>
38
39
        SetHandler fcgid-script
        Options +ExecCGI
40
    </Files>
41

Yadd's avatar
Yadd committed
42
    # If you want to use mod_fastcgi, replace lines below by:
Yadd's avatar
Yadd committed
43
    #FastCgiServer __MANAGERSITEDIR__/manager.fcgi
Yadd's avatar
Yadd committed
44

45
46
47
    # GLOBAL CONFIGURATION
    # --------------------

Yadd's avatar
Yadd committed
48
    DocumentRoot __MANAGERSITEDIR__
Yadd's avatar
Yadd committed
49
50

    <Location />
51
        Order Deny,Allow
Yadd's avatar
Yadd committed
52
       Allow from all
Yadd's avatar
Yadd committed
53
54
55
56
57
58
59
60
61
62
63
64
65
66

        <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>
    
67
    # Static files (javascripts, HTML forms,...)
Yadd's avatar
Yadd committed
68
69

    Alias /static/ __MANAGERSTATICDIR__/
Yadd's avatar
Yadd committed
70
    <Directory __MANAGERSTATICDIR__>
Yadd's avatar
Yadd committed
71
72
        Order deny,allow
        Allow from all
Yadd's avatar
Yadd committed
73
74
        Options +FollowSymLinks
    </Directory>
75
76

    # On-line documentation
77
    Alias /doc/ __DEFDOCDIR__
Yadd's avatar
Yadd committed
78
    Alias /lib/ __DEFDOCDIR__pages/documentation/current/lib/
79
    <Directory __DEFDOCDIR__>
Yadd's avatar
Yadd committed
80
        Order allow,deny
Yadd's avatar
Yadd committed
81
82
83
        Allow from all
        ErrorDocument 404 /notfound.html
        Options +FollowSymLinks
84
        DirectoryIndex index.html start.html
85
86
    </Directory>

87
88
89
90
91
92
93
    # French version (needs fr-doc installation)
    Alias /fr-doc/ __FRDOCDIR__
    <Directory __FRDOCDIR__>
        Order deny,allow
        Allow from all
        ErrorDocument 404 /notfoundfr.html
        Options +FollowSymLinks
94
        DirectoryIndex index.html start.html
95
96
    </Directory>

Yadd's avatar
Yadd committed
97
98
    # Uncomment this if site if you use SSL only
    #Header set Strict-Transport-Security 15768000
99
</VirtualHost>