Created
April 14, 2011 11:04
-
-
Save lopnor/919267 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
use warnings; | |
use Getopt::Long; | |
use Test::Httpd::Apache2; | |
use Path::Class; | |
my $port = 5000; | |
my $root = '.'; | |
Getopt::Long::GetOptions( | |
p => \$port, | |
d => \$root, | |
); | |
$root = dir($root)->absolute; | |
my $apache = Test::Httpd::Apache2->new( | |
auto_start => 0, | |
listen => $port, | |
required_modules => ['dav', 'dav_fs'], | |
); | |
my $tmpdir = $apache->tmpdir; | |
my $conf = <<END; | |
DavLockDB "$tmpdir/DavLock" | |
DocumentRoot "$root" | |
<Directory "/"> | |
Dav on | |
</Directory> | |
END | |
$apache->custom_conf($conf); | |
$apache->start; | |
while (1) {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment