~ubuntu-branches/ubuntu/karmic/ebox/karmic

« back to all changes in this revision

Viewing changes to stubs/apache.mas.in

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-01-26 18:21:18 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090126182118-b8lnqji849rhz3vz
Tags: 0.12.4-0ubuntu1
* New upstream release. (LP: #318710, LP: #310045).
* debian/control:
  - Bump standard version.
  - Depend on an apache2-mpm- rather then apache2 (LP: #225793).
  - Build depend on debconf-updatepo.
* debian/rules:
  - Call debconf-updatepo from clean target.
* debian/copyright:
  - Include section about apache-authcookie code.
* debian/ebox.postrm:
  - Remove ebox log files (LP: #129738).
* debian/ebox.prerm:
  - Stop ebox when the package is removed. (LP: #234912)
* debian/watch:
  - add watch file.
* debian/patches/01_add_apache_authcookie.dpatch
  - Patch to backport AuthCookie authentication for jaunty (LP: #255368).
* debian/patches/02_dbus_gconf.dpatch
  - Patch to make gconf classes work with new gconf using dbus 
    (LP: #314606).
* debian/patches/03_js_libraries.dpatch
  - Patch to use javascript libraries that are already package for
    Jaunty 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<%doc>
 
2
   Template to set the apache configuration file
 
3
   for the Web administration
 
4
 
 
5
Parameters:
 
6
 
 
7
   port - Int the listening port
 
8
   group - String the group that must live apache-perl process
 
9
   user  - String the user that the apache-perl process must be 
 
10
   serverroot - String the path to the Apache server root
 
11
   tmpdir - String the path to the Apache temporary directory
 
12
   debug - String to enable Apache::Reload or not *(Optional)*
 
13
           Default value: 'no'
 
14
   restrictedResources - Array containing a hash ref structure
 
15
                     which contains the following elements:
 
16
                - allowedIPs - array ref containing the allowed IPs
 
17
                               for accessing this resource
 
18
                - name - String the resource name
 
19
                - type - String the resource type. Options: file, directory or location.
 
20
</%doc>
1
21
<%args>
2
22
        $port
3
23
        $group
4
24
        $user
5
25
        $serverroot
 
26
        $tmpdir
6
27
        $debug => 'no'
 
28
        @restrictedResources => ()
7
29
</%args>
8
30
 
9
 
 
10
31
Timeout 300
11
 
KeepAlive On
 
32
KeepAlive Off
12
33
MaxKeepAliveRequests 100
13
34
KeepAliveTimeout 15
14
35
AddDefaultCharset utf-8 
15
36
 
 
37
PidFile <% $tmpdir %>/apache.pid
 
38
 
16
39
<IfModule mpm_prefork_module>
17
40
    StartServers          1 
18
 
    MinSpareServers       1
19
 
    MaxSpareServers       5
20
 
    MaxClients            5 
 
41
    MinSpareServers       1 
 
42
    MaxSpareServers       1
 
43
    MaxClients            2 
21
44
    MaxRequestsPerChild   20
22
45
</IfModule>
23
46
 
39
62
 
40
63
PerlInterpMaxRequests 20
41
64
 
42
 
Include /etc/apache2/mods-available/alias.load
43
65
Include /etc/apache2/mods-available/auth_basic.load
44
66
Include /etc/apache2/mods-available/authn_file.load
45
67
Include /etc/apache2/mods-available/authz_default.load
91
113
    Allow from all
92
114
</Directory>
93
115
 
 
116
<%perl>
 
117
if ( @restrictedResources > 0 ) {
 
118
    foreach my $restrictedResource (@restrictedResources) {
 
119
        my @allowIPs = @{$restrictedResource->{allowedIPs}};
 
120
        my $restrictedResourceName = $restrictedResource->{name};
 
121
        my $foundNobody = grep { $_ eq 'nobody' } @allowIPs;
 
122
        my $foundAll = grep { $_ eq 'all' } @allowIPs;
 
123
        my $type = $restrictedResource->{type};
 
124
        if ( $type eq 'file' ) {
 
125
           $type = 'Files';
 
126
        } elsif ( $type eq 'dir' ) {
 
127
           $type = 'Directory';
 
128
        } elsif ( $type eq 'location' ) {
 
129
           $type = 'Location';
 
130
        }      
 
131
</%perl>
 
132
<<% $type %> <% $restrictedResourceName %>>
 
133
    Order Allow,Deny
 
134
%        unless ( $foundNobody ) {
 
135
%            foreach my $ip (@allowIPs) {
 
136
    Allow from <% $ip %>
 
137
%            }
 
138
%        }
 
139
</<% $type %>>
 
140
%   }
 
141
% }
 
142
 
94
143
 
95
144
UseCanonicalName Off
96
145
TypesConfig /etc/mime.types
138
187
    BrowserMatch "JDK/1\.0" force-response-1.0
139
188
</IfModule>
140
189
 
141
 
Alias /data/ @WWWPATH@
142
 
Alias /dynamic-data @DYNAMICWWWPATH@
143
 
ScriptAlias /ebox/ @CGIPATH@
144
 
 
145
190
% if ($debug eq 'yes') {
146
191
# Yes, this is useless right now.
147
192
#PerlInitHandler        Apache2::Reload
148
193
% }
149
194
PerlWarn On
150
195
 
151
 
PerlRequire "/var/lib/ebox/conf/startup.pl"
 
196
# PerlRequire "/var/lib/ebox/conf/startup.pl"
152
197
 
153
198
PerlModule EBox::Auth
154
199
PerlSetVar EBoxPath /
184
229
 
185
230
RewriteEngine On
186
231
 
187
 
RewriteRule ^/ebox$ /ebox/ [R]
188
 
RewriteRule ^/$ /ebox/ [R]
189
 
RewriteRule ^/ebox/ebox.cgi$ [S,PT]
190
 
RewriteRule ^/ebox/(.*) /ebox/ebox.cgi [E=script:$1,PT,L]
 
232
# From /ebox to /ebox/ and redirect
 
233
RewriteRule ^/ebox$ /ebox/
 
234
# From / to /ebox and redirect
 
235
RewriteRule ^/$ /ebox/
 
236
# Map /ebox/ebox.cgi to the right Perl CGI and redirect
 
237
RewriteRule ^/ebox/ebox.cgi$ /ebox/
 
238
# From /data/ to / and finish
 
239
RewriteRule ^/data(.*) $1 [L]
 
240
# From /dynamic-data/ to the right directory in FS and finish
 
241
RewriteRule ^/dynamic-data(.*) @DYNAMICWWWPATH@$1 [L]
 
242
RewriteRule ^/ebox/(.*) @CGIPATH@ebox.cgi [E=script:$1,L]
191
243