nginixでWebDAVを使えるようにする

http://fukuyama.co/webdavを参考にさせていただいて、

nginixのsrcに移動して

git clone https://github.com/arut/nginx-dav-ext-module.git

nginxのsrcにcdして、

./configure –with-http_dav_module –add-module=../nginx-dav-ext-module

ローカルホストにブラウザからアクセスして成功。

http://sakamoto-san.com/nginx_digest_auth_httpauthdigestmodule.htmlで紹介されているDigest認証モジュールをGitHubから落とす。

https://github.com/samizdatco/nginx-http-auth-digest.git

使用していない変数があるとgccでエラーになるので、とりあえず、Makefileに
CFLAGS2 = -pipe -O -W -Wall -Wpointer-arith -g
を追加し、nginx-http-auth-digestはこれをCFLGSにするようにしてmake

htdigestでダイジェスト認証のファイルを作成する。realmに注意

sudo htdigest -c passwd.digest ‘for owner only’ 名前

nginx.confに以下を記述

auth_digest_user_file /usr/local/nginx/conf/passwd.digest; # a file created with htdigest
location /Documents{
root /見せる場所
auth_digest ‘for owner only’; # set the realm for this location block
autoindex on;

dav_access group:r all:r;
dav_ext_methods PROPFIND OPTIONS;
dav_methods PUT DELETE MKCOL COPY MOVE;
}

これで/Documentsは見えるが、その配下のディレクトリのうち半角スペースや日本語が入っているディレクトリは潜れない。たぶんファイルも無理のはず。

よって、nginxでは、まだマルチバイト対応はこれからという認識。

しかたないので、apacheで再度試してみます。ああ、疲れた。。