~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to debian/vhost-base/disable.d/apache2

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl
2
 
 
3
 
use Debian::Vhosts;
4
 
 
5
 
$hostname = shift;
6
 
$default = (vb_config_get("apache2", "default", "/var/lib/vhost-base/$hostname/conf/apache2.conf"))[0];
7
 
 
8
 
dbmopen(%sites, "/etc/apache2/sites", 0644);
9
 
if ($default eq "true") { 
10
 
        print(STDERR "Disabling default site: $hostname.\n");
11
 
        delete $sites{'default'};
12
 
}
13
 
 
14
 
 
15
 
unlink </etc/apache2/sites-enabled/*> || true;
16
 
if ($sites{'default'}) {
17
 
        foreach $i (</etc/apache2/sites-available/{$sites{'default'}}*>) {
18
 
                $i =~ s#/etc/apache2/sites-available/##;
19
 
                symlink("/etc/apache2/sites-available/$i", "/etc/apache2/sites-enabled/00-$i") || die "Failed to make symlink sites-available/$i -> site-enabled/$i\: $!";
20
 
        }
21
 
}
22
 
 
23
 
foreach $i (@{$sites{'nondefault'}}) {
24
 
        foreach $j (</etc/apache2/sites-available/$i*>) {
25
 
                $j =~ s#/etc/apache2/sites-available/##;
26
 
                symlink("/etc/apache2/sites-available/$j", "/etc/apache2/sites-enabled/01-$j") || die "Failed to make symlink sites-available/$j -> sites-enabled/$j\: $!";
27
 
        }
28
 
}
29
 
 
30
 
dbmclose(%sites);
31
 
exit(0);