原始资料:http://www.howtoforge.com/setting-up-webdav-with-apache2-on-debian-etch
apache+webdav的安装配置
在服务器上安装配置apache+webdav模块说明:
1.安装apache2+webdav
安装apache2:
sudo apt-get install apache2 |
sudo a2enmod dav_fs sudo a2enmod dav |
sudo /etc/init.d/apache2 force-reload |
a.建立存放数据目录并给apache用户(www-data)该目录的权限
sudo mkdir -p /var/www/web1/web sudo chown www-data /var/www/web1/web |
sudo mv /etc/apache2/sites-available/default /etc/apache2/sites-available/default_orig sudo vim /etc/apache2/sites-available/default |
NameVirtualHost * <VirtualHost *> ServerAdmin webmaster@localhost DocumentRoot /var/www/web1/web/ <Directory /var/www/web1/web/> Options Indexes MultiViews AllowOverride None Order allow,deny allow from all </Directory> </VirtualHost> |
c.重启apache:
sudo /etc/init.d/apache2 force-reload |
3.配置webdav的虚拟主机
sudo htpasswd -c /var/www/web1/passwd.dav test |
sudo htpasswd /var/www/web1/passwd.dav 10.34.14.91\\test |
sudo chown root:www-data /var/www/web1/passwd.dav sudo chmod 640 /var/www/web1/passwd.dav |
[...] Alias /webdav /var/www/web1/web <Location /webdav> DAV On AuthType Basic AuthName "webdav" AuthUserFile /var/www/web1/passwd.dav Require valid-user </Location> [...] |
NameVirtualHost * <VirtualHost *> ServerAdmin webmaster@localhost DocumentRoot /var/www/web1/web/ <Directory /var/www/web1/web/> Options Indexes MultiViews AllowOverride None Order allow,deny allow from all </Directory> Alias /webdav /var/www/web1/web <Location /webdav> DAV On AuthType Basic AuthName "webdav" AuthUserFile /var/www/web1/passwd.dav Require valid-user </Location> </VirtualHost> |
sudo /etc/init.d/apache2 reload |
sudo apt-get install davfs2 sudo mount -t davfs http://localhost/webdav ./local sudo chmod 777 local |
sudo umount local |