Skip to content

Instantly share code, notes, and snippets.

@lopnor
Created April 14, 2011 11:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lopnor/919267 to your computer and use it in GitHub Desktop.
Save lopnor/919267 to your computer and use it in GitHub Desktop.
#!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