WebDAV, an extension of HTTP protocol, can now be accessed through LigHTTPd WebDAV integrations. With this, you can now edit your files directly on the LigHTTPd server without the need of downloading or uploading it with FTP. Even more important, WebDAV is also useful to download and upload files.
If you wish to experience the advantage of LigHTTPd WebDAV, you can follow these steps:

LigHTTPd WebDAV installation

  1. Enable EPEL: As root issue these commands:
  2. wget https://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm – ivh epel-release-6-8.noarch.rpm
  3. Install the LigHTTPd: As root issue with this command: Yum install lighttpd

Now that you have learned about the installation of LigHTTPd WebDAV, let us proceed to the configuration.

lighttpd webDAV
LigHTTPd WebDAV configuration

If IPv6 must not be utilized or unsupported, then modify the file
/etc/lighttpd/lighttpd.conf and change server.use-ipv6 to disable:
Server.use-ipv6 = “disable”
If you want to disable a returning error as the Expect header is in requests, or if you want to boost the number of supported parallel requests, you can augment these lines to
/etc/lighttpd/lighttpd.conf file:
server. reject-expect-100-with-417 = “disable”
server.max-fds = 2048
server.max-connections = 1024

Adjust the server.groupname and server.username in
/etc/lighttpd/lighttpd.conf

You must check if the user has access to the lighttpd directories (e.g., var.log_root, var.state_dir, var.home_dir) as well as others in
/etc/init.d/lighttpd and in/etc/lighttpd/lighttpd.conf

Enable the WebDAV module through editing the /etc/lighttpd/modules.conf file and by uncommenting the subsequent line:
include “conf.d/webdav.conf”

Next, change WebDAV module configuration through editing the file
/etc/lighttpd/conf.d/webdav.conf. You can also use webdav.activate = “enable” if you want your directories and files in your server. document-root for accessibility in WebDAV.

You must also check if the webdav.sqlite-db-name parameter is commented on webdav.conf

Restart the lighttpd server:
/etc/init.d/lighttpd restart
Lighttpd WebDAV log in
Lighttpd requires the mod_webdav module in supporting WebDAV. For example, if you use mod_auth to log in with Window and it doesn’t work as it activates WebDAV, then there is a possibility that it is compensated through a cookie-based login.
Making a virtual host
In making a virtual host, you can follow this code:
mkdir-p /var/www/web1/web
chown www-data:www-data / var/www/web1/web
Next, you can open /etc/lighttpd/lighttpd.conf and add the following vhost on the end of the file:
nano/etc/ lighttpd/lighttpd.conf
[…]
$HTTP [“host”] == www.example.com {
server.document-root = “/var/www/web1/web”
}

Then, you can restart the lighttpd:
service lighttpd restart

Configuration of Virtual Host for LigHTTPd WebDAV

You can now make the password file for WebDAV
/var/www/web1/passwd.dav with the user test (the -c switch creates the file if it doesn’t exist):
htpasswd – c/ var/www/web1/passwd.dav test
You will be asked to enter the password for user test.

Edit the permission of the
/var/www/web1/passwd.dav file so the root and the members of the www-data group can access it:
chown root: www-data/ var/www/web1/passwd.dav
chmod 640 / var/ www/web1/passwd.dav

You can now modify your vhost in /etc/lighttpd/lighttpd.conf so, it can look as follows:
Nano/etc/lighttpd/ lighttpd.conf
Restart the Lighttpd
service lighttpd restart
Testing WebDAV

Install a cadaver, a command-line WebDAV client:
Apt-get -y install cadaver

If you want to test if WebDAV is working, you can enter:
Cadaver http: //www.example.com/webdav/