[LINUX] A memorandum to make WebDAV only with nginx

Introduction

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.

Build

It is not included in the default module, so you need to add the module to build nginx.

Get the source code

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.

Install build-dependent packages

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

Import WebDAV extension module

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)

Build time

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.

Install and check

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.

References

-Try using WebDAV extension module (ngx-dav-ext-module) in nginx on Ubuntu (Debian) -Try sharing files with webDAV on nginx

Recommended Posts

A memorandum to make WebDAV only with nginx
How to make a dictionary with a hierarchical structure.
I want to make a game with Python
Try to make a "cryptanalysis" cipher with Python
Try to make a dihedral group with Python
(Memorandum) Make a 3D scatter plot with matplodlib
I tried to create a table only with Django
Try to make a command standby tool with python
How to make a shooting game with toio (Part 1)
Make a function to describe Japanese fonts with OpenCV
Easy to make with syntax
Make a fortune with Python
Make a fire with kdeplot
How to make a Cisco Webex Teams BOT with Flask
I want to make a blog editor with django admin
Experiment to make a self-catering PDF for Kindle with Python
I want to make a click macro with pyautogui (desire)
How to make a simple Flappy Bird game with pygame
I want to make a click macro with pyautogui (outlook)
How to make a Japanese-English translation
Let's make a GUI with python.
Make a sound with Jupyter notebook
A memorandum to change to Manjaro Linux
How to make a slack bot
Let's make a breakout with wxPython
How to make a crawler --Advanced
How to make a recursive function
Make a recommender system with python
How to make a deadman's switch
[Blender] How to make a Blender plugin
Make a filter with a django template
Let's make a graph with python! !!
Let's make a supercomputer with xCAT
How to make a crawler --Basic
Make a model iterator with PySide
Make a nice graph with plotly
[5th] I tried to make a certain authenticator-like tool with python
I tried to make a system that fetches only deleted tweets
Rubyist tried to make a simple API with Python + bottle + MySQL
[2nd] I tried to make a certain authenticator-like tool with python
Make it possible to output a log to a file with go echo
A memorandum when I tried to get it automatically with selenium
django + nginx How to make images viewed only by logged-in users
[3rd] I tried to make a certain authenticator-like tool with python
How to make a command to read the configuration file with pyramid
How to make a surveillance camera (Security Camera) with Opencv and Python
Make your own VPC with a Single Public Subnet Only with boto
Try to make a web service-like guy with 3D markup language
I tried to make a periodical process with Selenium and Python
I tried to make a 2channel post notification application with Python
[Introduction] I want to make a Mastodon Bot with Python! 【Beginners】
I tried to make a todo application using bottle with python
[4th] I tried to make a certain authenticator-like tool with python
[1st] I tried to make a certain authenticator-like tool with python
I tried to make a strange quote for Jojo with LSTM
I tried to make a mechanism of exclusive control with Go
Memorandum (Add name only to people with the same surname in the list)
Let's make a shiritori game with Python
Make a video player with PySimpleGUI + OpenCV
Python beginners decided to make a LINE bot with Flask (Flask rough commentary)
Python to remember only with hello, worlds