File: startup.pl

package info (click to toggle)
libapache2-mod-perl2 2.0.4-5%2Blenny1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 9,868 kB
  • ctags: 3,820
  • sloc: perl: 56,663; ansic: 14,001; makefile: 91; sh: 38
file content (33 lines) | stat: -rw-r--r-- 843 bytes parent folder | download | duplicates (4)
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
use warnings;
use strict;

use Apache2::ServerUtil ();
use Apache2::ServerRec ();

use File::Spec::Functions qw(catdir);

# base server
# XXX: at the moment this is wrong, since it return the base server $s
# and not the vhost's one. needs to be fixed.
my $s = Apache2::ServerUtil->server;

my $vhost_doc_root = catdir Apache2::ServerUtil::server_root, qw(htdocs vhost);

# testing $s->add_config() in vhost
my $conf = <<"EOC";
# must use PerlModule here to check for segfaults
# and that the module is loaded by vhost
PerlModule TestVhost::config
PerlSetVar DocumentRootCheck $vhost_doc_root
<Location /TestVhost__config>
    SetHandler modperl
    PerlResponseHandler TestVhost::config::my_handler
</Location>
EOC

$s->add_config([split /\n/, $conf]);

# this used to have problems on win32
$s->add_config(['<Perl >', '1;', '</Perl>']);

1;