How To Set Up WebDAV With Apache2 On OpenSUSE 12.2
|
Submitted by falko (Contact Author) (Forums) on Wed, 2012-10-17 18:04. :: SuSE | Web Server | Apache
How To Set Up WebDAV With Apache2 On OpenSUSE 12.2Version 1.0 This guide explains how to set up WebDAV with Apache2 on an OpenSUSE 12.2 server. WebDAV stands for Web-based Distributed Authoring and Versioning and is a set of extensions to the HTTP protocol that allow users to directly edit files on the Apache server so that they do not need to be downloaded/uploaded via FTP. Of course, WebDAV can also be used to upload and download files. I do not issue any guarantee that this will work for you!
1 Preliminary NoteI'm using an OpenSUSE 12.2 server with the IP address 192.168.0.100 here.
2 Installing WebDAVIf Apache is not already installed, install it as follows: zypper install apache2 Afterwards, enable the WebDAV modules: a2enmod dav Then create the system startup links for Apache and start it: systemctl enable apache2.service systemctl start apache2.service
3 Creating A Virtual HostI will now create an Apache vhost www.example1.com in the directory /srv/www/web1/web. If you already have a vhost for which you'd like to enable WebDAV, you must adjust this tutorial to your situation. First, we create the directory /srv/www/web1/web and make the Apache user (wwwrun) and group (www) the owner of that directory: mkdir -p /srv/www/web1/web Now we create the Apache vhost for www.example1.com: vi /etc/apache2/vhosts.d/www.example1.com.conf
Open /etc/apache2/httpd.conf and add the line NameVirtualHost * before the Include /etc/apache2/vhosts.d/*.conf line: vi /etc/apache2/httpd.conf
Then restart Apache: systemctl restart apache2.service
4 Configure The Virtual Host For WebDAVNow we create the WebDAV password file /srv/www/web1/passwd.dav with the user test (the -c switch creates the file if it does not exist): htpasswd2 -c /srv/www/web1/passwd.dav test You will be asked to type in a password for the user test. (Please don't use the -c switch if /srv/www/web1/passwd.dav is already existing because this will recreate the file from scratch, meaning you lose all users in that file!) Now we change the permissions of the /srv/www/web1/passwd.dav file so that only root and the members of the www group can access it: chown root:www /srv/www/web1/passwd.dav Now we modify our vhost www.example1.com in /etc/apache2/vhosts.d/www.example1.com.conf and add the following lines to it: vi /etc/apache2/vhosts.d/www.example1.com.conf
The Alias directive makes (together with <Location>) that when you call /webdav, WebDAV is invoked, but you can still access the whole document root of the vhost. All other URLs of that vhost are still "normal" HTTP. The final vhost should look like this:
Next we must specify the location of the WebDAV lock database. I want to have it in /var/lib/dav/ so I create that directory now: mkdir /var/lib/dav/ Open /etc/apache2/httpd.conf and add a DAVLockDB directive above the NameVirtualHost *:80 line: vi /etc/apache2/httpd.conf
Restart Apache afterwards: systemctl restart apache2.service
5 Testing WebDAVWe will now install cadaver, a command-line WebDAV client: zypper install cadaver To test if WebDAV works, type: cadaver http://www.example1.com/webdav/ You should be prompted for a user name. Type in test and then the password for the user test. If all goes well, you should be granted access which means WebDAV is working ok. Type quit to leave the WebDAV shell: server1:~ # cadaver http://www.example1.com/webdav/ You can now start using WebDAV as described in the chapters 6 and 7 of the tutorial How To Set Up WebDAV With Apache2 On Ubuntu 9.10. The WebDAV URL is http://www.example1.com/webdav/ for Linux clients and http://www.example1.com:80/webdav/ for Windows clients.
6 Links
|




Recent comments
1 day 2 hours ago
1 day 5 hours ago
1 day 6 hours ago
1 day 8 hours ago
1 day 9 hours ago
1 day 11 hours ago
1 day 12 hours ago
2 days 4 hours ago
2 days 5 hours ago
2 days 9 hours ago