-
Notifications
You must be signed in to change notification settings - Fork 25
README_APACHE_DAV
OpenLink Software edited this page Nov 17, 2015
·
4 revisions
$ sudo yum install httpd
All relevant modules are already enabled in a default installation.
$ cd /etc/httpd
$ sudo htpassword -c webdav.user dav
New password: MySecretPassword
Re-type new password: MySecretPassword
Added password for user dav
And set the appropriate owner and permissions:
$ sudo chown root:apache webdav.user
$ sudo chmod 640 webdav.user
$ cd /etc/httpd
$ sudo htpassword webdav.user NewUser
$ cd /var/www/html
$ sudo mkdir DAV
$ sudo chown apache:apache DAV
Select the text at the end of this file and paste it into a file called dav.conf and move it to /etc/httpd/conf.d/dav.conf
$ sudo /sbin/service httpd restart
Using your favorite browser, click on the sample link to get a directory listing of your /DAV folder.
$ sudo apt-get update
$ sudo apt-get install apache2 apache2-utils
$ sudo a2enmod dav dav_fs headers
$ cd /etc/apache2
$ sudo htpassword -c webdav.user dav
New password: MySecretPassword
Re-type new password: MySecretPassword
Added password for user dav
And set the appropriate owner and permissions:
$ sudo chown root:www-data webdav.user
$ sudo chmod 640 webdav.user
$ cd /etc/apache2
$ sudo htpassword webdav.user NewUser
$ cd /var/www/html
$ sudo mkdir DAV
$ sudo chown www-data DAV
Select the text at the end of this file and paste it into a file called dav.conf and move it to /etc/apache2/conf-enabled/dav.conf
$ sudo service apache2 restart
Using your favorite browser, click on the sample link to get a directory listing of your /DAV folder.
<Location /DAV>
Order Allow,Deny
#
# Enable mod_dav on this location
#
Dav on
DavDepthInfinity on
#
# Disable the rewrite engine if it interferes with /DAV repository (optionally uncomment)
#
#RewriteEngine off
#
# Use basic authentication
#
AuthType Basic
AuthName WebDAV
AuthUserFile webdav.user
#
# Set the DAV tree to be private, so all operations require an authenticated user
#
# To make this DAV repository publicly readable, remove the GET and PROPFIND keywords below
#
<Limit GET PROPFIND PROPPATCH PUT POST DELETE MKCOL COPY MOVE LOCK UNLOCK>
Require valid-user
</Limit>
#
# Enable CORS to allow cross-side Ajax scripting
#
Header always set Access-Control-Allow-Credentials true
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Headers "authorization, origin, x-requested-with, content-type"
Header always set Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS, PROPFIND"
</Location>