Raspberry PI
rpi4 Debian : nginx + rtmp + webdav 설치
SOMSOC
2021. 6. 12. 21:26
http://www.webdav.org/projects/
$ sudo apt update
$ sudo apt upgrade
*) nginx 웹서버 설치
$ sudo apt install nginx nginx-full
*) rtmp 모듈 설치
$ sudo apt install libnginx-mod-rtmp
*) ngx-mod-http-headers-more-filter 모듈 설치
$ sudo apt install libnginx-mod-http-headers-more-filter
*권장) 모든 모듈 설치
$ sudo apt install libnginx*
$ sudo apt-get install nginx-extras
*) webdav 폴더 생성
$ sudo mkdir /var/www/webdav
*) webdav 폴더 사용자 설정
$ sudo chown www-data:www-data /var/www/webdav
$ sudo service nginx reload
*) webdev 사용자 설정
$ sudo apt install apache2-utils
$ htpasswd -c webdavpw.pwd user01
New password:
Re-type new password:
Adding password for user user01
$ cat ~/webdavpw.pwd
user01:$apr1$Q2AMD3rm$iA89QhjsV5v.Rk5GANgtO/
$ sudo vi /etc/nginx/webdavpw.pwd
user01:$apr1$Q2AMD3rm$iA89QhjsV5v.Rk5GANgtO/
$ sudo vi /etc/nginx/nginx.conf
...
http {
dav_ext_lock_zone zone=pi:10m;
...
$ sudo vi /etc/nginx/sites-available/default
...
# 이곳을 찾어
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# 이렇게 추가 해준다.
location /webdav {
charset utf-8;
alias /var/www/webdav;
autoindex on;
auth_basic "WebDAV Page";
auth_basic_user_file /etc/nginx/webdavpw.pwd;
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS LOCK UNLOCK;
dav_ext_lock zone=pi;
dav_access user:rw group:rw all:r;
client_max_body_size 0;
create_full_put_path on;
DAVMinTimeout 600;
}
# 여기까지 추가 해준다,
}
...
$ sudo service nginx reload
$ curl -T 업로드파일명 -u 사용자ID:PASSWD http://localhost/webdav
$ sudo apt-get install cadaver
$ cadaver http://localhost/webdav
...
Could not access /webdav/ (not WebDAV-enabled?):
404 Not Found <==== alias 지정 경로에 폴더가 없을때 mkdir /var/www/wedav; chown www-data:www-data /var/www/webdav
...
탐색기에서 파일 생성 할 때 : 0x8000ffff
...
탐색기에서 폴더 생성 할 때 : 0x80070021
...
*) Windows 10에서 webDAV연결 하기
파일 탐색기
==> 내PC : 선택 후
==> 창 상단 : 컴퓨터
==> 네트워크 드라이브 연결
==> 폴더 란에 : http://192.168.0.99/webdav
...
설정 후
파일 탐색기
==> 내PC : 오른쪽 마우스
==> 네트워크 위치 추가
*) Windows 10에서 WebClient 설정 하기
*) regedit
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters
===> FileSizeLimitInBytes : 4194304000 (4GB)로 수정
===> BasicAuthLevel : 2 로 수정
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YGytCAG&l=ko-KR
https://doc.cuba-platform.com/webdav-2.5/
https://docs.microsoft.com/en-us/troubleshoot/windows-client/networking/cannot-automatically-reconnect-dav-share
https://docs.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2003/aa142897(v=exchg.65)
https://docs.oracle.com/cd/E19857-01/817-7510/agdav.html
*) PROPPATCH 기능 있는 모듈 설치 하기
Nginx WebDAV Service – Hev's Blog
0x01 Installation git clone --depth 1 https://github.com/heiher/nginx cd nginx git clone --depth 1 https://github.com/heiher/nginx-dav-ext-module ./auto/configure --prefix=/opt/nginx \ --with-compat \ --with-file-aio \ --with-http_addition_module \ --wi
hev.cc
$ git clone --depth 1 https://github.com/heiher/nginx
$ cd nginx
$ git clone --depth 1 https://github.com/heiher/nginx-dav-ext-module
$ sudo apt install libpcre3-dev libxslt1-dev libgeoip-dev
$ ./auto/configure --prefix=/opt/nginx \
--with-compat \
--with-file-aio \
--with-http_addition_module \
--with-http_auth_request_module \
--with-http_dav_module \
--with-http_degradation_module \
--with-http_flv_module \
--with-http_geoip_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_mp4_module \
--with-http_realip_module \
--with-http_secure_link_module \
--with-http_slice_module \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_sub_module \
--with-http_v2_module \
--with-pcre-jit \
--with-threads \
--add-module=nginx-dav-ext-module