WebDAVCGIをAmazonLinuxにインストール

WebDavCGIの公式ページにはYum系のやり方が載っていなかったのでメモ書き程度に。

はまったポイントとしてはBasic認証だけでなく同じ名前のLinuxユーザーも作らないと動かないこと

yum install gcc quota-devel perl-CPAN perl-YAML perl-CGI perl-DBI perl-XML-Simple perl-Archive-Zip perl-Module-Load perl-JSON perl-DateTime

cpan
cpan[1]>install CPAN::DistnameInfo
cpan[1]>install Date::Parse
cpan[1]>install Time::HiRes
cpan[1]>install UUID::Tiny
cpan[1]>install Quota
cpan[1]>install ExtUtils::Command::MM
cpan[1]>force install version
cpan[1]>install File::Spec::Link
cpan[1]>install IO::Compress::Gzip
cpan[1]>install DateTime::Format::Human::Duration

yum install jasper-libs lcms-libs libtiff libwmf-lite urw-fonts
rpm -ivh http://dl.atrpms.net/el5-x86_64/atrpms/testing/libtool-ltdl-2.2.6-15.5.el5.1.x86_64.rpm
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/GraphicsMagick-1.3.17-1.el6.x86_64.rpm
rpm -ivh ftp://rpmfind.net/linux/epel/6/x86_64/GraphicsMagick-perl-1.3.17-1.el6.x86_64.rpm

wget http://downloads.sourceforge.net/project/webdavcgi/webdavcgi-latest.zip
unzip webdavcgi-latest.zip
mv webdavcgi-0.8.6 /etc/httpd/webdavcgi
cd /etc/httpd/webdavcgi
sh install.sh

設定ファイル「/etc/httpd/domains/username.cgi.conf」を追加します

## the install base is needed to find webdav-ui.* and locale files
## (don't forget the trailing slash):
$INSTALL_BASE='/etc/httpd/webdavcgi/';

## the backend module (supported: FS, AFS, GFS, SMB, DBB, RCS):
$BACKEND = 'FS';

## this is an example if a user starts with home dir (http://mywebdavserver/ -> user home):
$VIRTUAL_BASE = '/username';
$DOCUMENT_ROOT = '/var/www/webdav/username/';
## if you use a complex home folder structure, try this:
# $DOCUMENT_ROOT=(getpwnam($ENV{REMOTE_USER}))[7].'/';


$DBI_SRC='dbi:SQLite:dbname=/tmp/webdav.'.$ENV{REMOTE_USER}.'.db';
$DBI_USER='';
$DBI_PASS='';
$CREATE_DB = !-e '/tmp/webdav.'.$ENV{REMOTE_USER}.'.db';

$THUMBNAIL_CACHEDIR="/tmp";

/etc/httpd/conf.d/webdav.conf に追記

ScriptAlias /admin/username/webdavcgi /etc/httpd/webdavcgi/cgi-bin/webdavwrapper
RewriteEngine On
RewriteRule ^/admin/username/ /username/webdavcgi [PT,E=WEBDAVCONF:/etc/httpd/domains/username.cgi.conf,E=PERLLIB:/etc/httpd/webdavcgi/lib/perl,L]