*** Last updated on Dec 06, 2017 ***
So you decided to add a WebDAV support into NGINX or Apache on Directadmin server with Custombuild 2.x. Here you can find a basic guide on how to achieve it. First of all please keep in mind, that:
IMPORTANT: NGINX should be built with nginx-dav-ext-module if you want it to support WebDAV methods PROPFIND & OPTIONS which are missing by default. This guide does not cover this aspect.
That's all. Now we need to update settings and configs, and here is how you can do it:
*** New way (since Autumn 2017) ***
The recent update of custombuild (v2.x) makes the things easier for changing. Please note you can now find
http_methods=GET:HEAD:POST
in /usr/local/directadmin/custombuild/options.conf. If it's missing then you could try and run
cd /usr/local/directadmin/custombuild/ ./build update
to download the latest custombuild version and update list of options.
Control it with the following commands:
# cd /usr/local/directadmin/custombuild/ # grep GET options.conf http_methods=GET:HEAD:POST
Now it's time to enable desired methods, use the following command:
./build set http_methods GET:HEAD:POST:PROPFIND:OPTIONS:PUT:DELETE:MKCOL:COPY:MOVE:REPORT
and rewrite configs
cd /usr/local/directadmin/custombuild && ./build rewrite_confs
in order to get all the changes applied.
That's it.
*** Old way ***
To add a support for WebDAV, CardDav, CalDav in NGINX on a server with Directadmin and Custombuild 2.x you should modify files:
/etc/nginx/webapps.conf /etc/nginx/webapps.hostname.conf /etc/nginx/webapps.ssl.conf
They contain the following code:
if ($request_method !~ ^(GET|HEAD|POST)$ ) { return 444; }
So the lines should be changed to
if ($request_method !~ ^(GET|HEAD|POST|PROPFIND|OPTIONS|PUT|DELETE|MKCOL|COPY|MOVE|REPORT)$ ) { return 444; }
Apache (from CustomBuild/Directamin) is configured to allow only GET, POST, OPTIONS, PROPFIND methods by default, so you need to update the following files:
/etc/httpd/conf/extra/httpd-directories-new.conf /etc/httpd/conf/extra/httpd-directories-old.conf
Update the lines:
<Limit GET POST OPTIONS PROPFIND> Order allow,deny Allow from all </Limit> <LimitExcept GET POST OPTIONS PROPFIND> Order deny,allow Deny from all </LimitExcept>
to:
<Limit GET POST OPTIONS PROPFIND HEAD PUT DELETE MKCOL COPY MOVE REPORT> Order allow,deny Allow from all </Limit> <LimitExcept GET POST OPTIONS PROPFIND HEAD PUT DELETE MKCOL COPY MOVE REPORT> Order deny,allow Deny from all </LimitExcept>
save changes and restart Apache.
After you modified the files:
/etc/nginx/webapps.conf /etc/nginx/webapps.hostname.conf /etc/nginx/webapps.ssl.conf
you need to copy them into
/usr/local/directadmin/custombuild/custom/nginx/conf/webapps.conf /usr/local/directadmin/custombuild/custom/nginx/conf/webapps.hostname.conf /usr/local/directadmin/custombuild/custom/nginx/conf/webapps.ssl.conf
Note, currently it's still custom/nginx/conf even if you use nginx_apache. And you won't see the files in either
/usr/local/directadmin/custombuild/configure/nginx_reverse/conf/
or /usr/local/directadmin/custombuild/custom/nginx_reverse/conf/.
And Apache's files that you changed should be copied to /usr/local/directadmin/custombuild/custom/ap2/conf/extra/