ubuntu Nginx webdav Setting
1.확장 모튤 다운로드
1 |
git clone https://github.com/arut/nginx-dav-module.git |
2.Nginx 컴파일
1 |
./configure --prefix=/sys/nginx-1.4.2 --pid-path=/sys/nginx-1.4.2/run/nginx.pid --lock-path=/sys/nginx-1.4.2/run/nginx.lock --http-client-body-temp-path=/webserver/cache/client_temp --http-proxy-temp-path=/webserver/cache/proxy_temp --http-fastcgi-temp-path=/webserver/cache/fastcgi_temp --http-uwsgi-temp-path=/webserver/cache/uwsgi_temp --http-scgi-temp-path=/webserver/cache/scgi_temp --with-http_addition_module --with-http_degradation_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_random_index_module --with-http_realip_module --with-http_mp4_module --with-http_flv_module --with-http_dav_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_secure_link_module --with-file-aio --with-ipv6 --with-pcre=../pcre-8.32 --add-module=<strong>../nginx-dav-ext-module</strong> |
3.make && make install
4.nginx conf
1 2 3 4 5 6 7 8 9 10 11 |
location /webdav { autoindex on; alias /media/videos; #접근경로 auth_basic "Restricted Access"; auth_basic_user_file /sys/nginx/security/.htpasswd; # 비번 저장 위치 client_body_temp_path /home04/temp; # 임시파일 저장 위치 dav_methods PUT DELETE MKCOL COPY MOVE; # 기본모듈 옵션 dav_ext_methods PROPFIND OPTIONS; # 확장모듈 옵션 create_full_put_path on; dav_access user:rw group:rw all:r; #관리 권한에 대한 내용 } |
.htpasswd 생성방법
1 |
echo "userid:$(openssl passwd -crypt password)" >> /sys/nginx/security/.htpasswd |