This article is based on the debian series (Ubuntu series).
WebDAV methods are also included in the standard deb package of nginx, but there are no methods for some functions (PROPFIND, OPTIONS), and some apps do not work well, so I will write an article to add those methods. I'm writing.
The version is entered in * written in the article.
It is not included in the default module, so you need to add the module to build nginx.
Get the nginx source code with the apt command. The directory doesn't matter, but it's a good idea to put it around ``` / usr / src /` ``.
# apt source nginx
When the order is completed, the source code (`nginx-*. *. *`
) Will be placed in the current directory.
Dependent packages are written in Build-depends of the file `` `debian / control``` in the source root directory, so install it by relying on it. The dependent packages of the version (1.16.1) installed this time are as follows.
# apt install debhelper dh-systemd dpkg-dev quilt lsb-release libssl-dev libpcre3-dev zlib1g-dev
Execute the following command in the source root directory.
# git clone https://github.com/arut/nginx-dav-ext-module.git
Then make a few changes to make it a deb package.
debian/rules
#abridgement
# 39~Near line 41
config.status.nginx: config.env.nginx
cd $(BUILDDIR_nginx) && \
#Towards the end" --add-module=/path/to/nginx-*.*.*/nginx-dav-ext-module "Add.
#Change the directory accordingly.
CFLAGS="" ./configure --prefix=/etc/nginx ... --add-module=/path/to/nginx-*.*.*/nginx-dav-ext-module
touch $@
# 44~Near line 46
config.status.nginx_debug: config.env.nginx_debug
cd $(BUILDDIR_nginx_debug) && \
#Added the same as above.
CFLAGS="" ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx ... --add-module=/path/to/nginx-*.*.*/nginx-dav-ext-module
touch $@
# (abridgement)
All you have to do is do this and wait.
# dpkg-buildpackage -uc -b
If successful, the deb package will be one above the source root directory.
All you have to do is install it with dpkg.
# dpkg -i nginx_*.*.*_*.deb
After the installation is complete, execute the following command to check.
$ nginx -V
in configure arguments--with-http_dav_module and--add-module=/path/to/nginx-*.*.*/nginx-dav-ext-If the module is included, you're done.
# Set
I will omit the rough settings. Please change it arbitrarily.
```nginx
location / {
#Set if necessary
# auth_basic "Authorize dialog message";
# auth_basic_user_file /path/to/.htpasswd;
#Setting of standard methods and methods for additional modules
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS;
#Settings to display the file list
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
#Read / write permission settings
dav_access user:rw group:rw all:r;
#Permission to create temporary files and directories
client_body_temp_path /var/www/.webdavtmp;
create_full_put_path on;
}
Reboot nginx and you're done.
-Try using WebDAV extension module (ngx-dav-ext-module) in nginx on Ubuntu (Debian) -Try sharing files with webDAV on nginx
Recommended Posts