WebDAV --- Web-based Distributed Authoring and Versioning
$ env CPPFLAGS='-I/usr/pkg/include -I/opt/webdav/include' ...
LDFLAGS='-L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib ...
-L/opt/webdav/lib -Wl,-rpath,/opt/webdav/lib' ...
./configure --prefix=/opt/webdav ...
--enable-mods-shared=all ...
--enable-ssl --with-ssl=/usr
$ make
$ sudo make install
$ env CPPFLAGS='-I/usr/pkg/include -I/opt/webdav/include' ...
LDFLAGS='-L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib ...
-L/opt/webdav/lib -Wl,-rpath,/opt/webdav/lib' ...
./configure --prefix=/opt/webdav --enable-shared ...
--with-berkeley-db=/usr/pkg --with-apr=/opt/webdav ...
--with-apr-util=/opt/webdav --with-apxs=/opt/webdav/bin/apxs
$ make
$ sudo make install
$ cd mod_encoding-*/lib $ ./configure --prefix=/opt/webdav $ gmake $ sudo gmake install $ cd .. $ sudo apcs -i -c -a -Wl,-rpath,/opt/webdav/lib ... -L /opt/webdav/lib -l iconv_hook mod_encoding.c
http://サーバ名/uploads/にアクセスし,adminというユーザ名で認証が成功すると,ファイルのアップロードができるようになる.
http://サーバ名/uploads/へのアクセスはforbiddenとなる.)/opt/webdav/conf/httpd.confを編集
#Include conf/extra/httpd-dav.conf
LoadModule dav_module modules/mod_dav.so LoadModule dav_fs_module modules/mod_dav_fs.so
/opt/webdav/conf/extra/httpd-dav.confを編集
DavLockDB "/opt/webdav/var/DavLock"
Alias /uploads "/opt/webdav/uploads"
<Directory "/opt/webdav/uploads">
Dav On
AuthType Digest
AuthName DAV-upload
AuthUserFile "/opt/webdav/user.passwd"
<LimitExcept GET OPTIONS>
require user admin
</LimitExcept>
Order allow,deny
Allow from all
</Directory>
$ sudo htdigest -c /opt/webdav/user.passwd DAV-upload admin Adding password for admin in realm DAV-upload. New password: ******** Re-type new password: ********
# mkdir -p /opt/webdav/uploads /opt/webdav/var # chown dav:dav /opt/webdav/uploads /opt/webdav/var
conf/extra/httpd-dav.confに,以下を追加.
Alias /cgi-enable "/opt/webdav/cgi"
Alias /cgi-disable "/opt/webdav/cgi"
<Location /cgi-enable>
Order allow,deny
Allow from all
Options +Include +ExecCGI
AddHandler cgi-script .cgi
</Location>
<Location /cgi-disable>
Dav On
ForceType text/plain
AuthType Digest
AuthName DAV-upload
AuthUserFile "/opt/webdav/user.passwd"
Require valid-user
Order allow,deny
Allow from all
</Directory>
http://サーバ名/cgi-enable/cgiスクリプト.cgiにアクセスすると,cgiやssiが実行される.(webdavは使えない)
http://サーバ名/cgi-disable/にアクセスすると,ソースファイルが見える.
<Location /repos>
Dav svn
SVNPath /u/repos
Order allow,deny
Allow from all
AuthType Digest
AuthName Repository
AuthUserFile "/opt/webdav/user.passwd"
Require valid-user
</Location>
$ sudo htdigest /opt/webdav/user.passwd Repository ユーザー名 Adding password for ユーザー名 in realm Repository. New password: ******** Re-type new password: ********
$ sudo svnadmin create /u/repos $ sudo chown -R dav:dav /u/repos
locationの中に,svnautoversioning onを追加する.
LoadModule encoding_module modules/mod_encoding.so
<IfModule mod_encoding.c>
EncodingEngine on
NormalizeUsername on
SetServerEncoding UTF-8
DefaultClientEncoding JA-AUTO-SJIS-MS SJIS
AddClientEncoding "cadaver/" EUC-JP
</IfModule>