进入终端:
STEP1:安装apache2服务:
sudo apt-get install apache2
STEP2:启用关联到的模块:
sudo a2enmod dav_fs
sudo a2enmod dav
sudo a2enmod dav_lock
STEP3:关联SO文件:
sudo ln -s /etc/apache2/mods-available/dav.load /etc/apache2/mods-enabled/dav.load
sudo ln -s /etc/apache2/mods-available/dav_fs.load /etc/apache2/mods-enabled/dav_fs.load
sudo ln -s /etc/apache2/mods-available/dav_lock.load /etc/apache2/mods-enabled/dav_lock.load
sudo ln -s /etc/apache2/mods-available/dav_fs.conf /etc/apache2/mods-enabled/dav_fs.conf
STEP4:重启服务:
sudo /etc/init.d/apache2 restart
STEP5:创建虚拟主机:
mkdir /var/www/sync
chown www-data:www-data /var/www/sync
STEP6:创建用户:
sudo htpasswd -c /var/www/me.dav terry
--这里会要求你重新办理确认密码
sudo chown root:www-data /var/www/me.dav
sudo chmod 640 /var/www/me.dav
STEP7:配置虚拟主机:
sudo gedit /etc/apache2/sites-available/default
在VirtualHost 节点中加入以下配置信息:
DocumentRoot /var/www/sync/
<Directory /var/www/sync/>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
Alias /webdav /var/www/sync
<Location /webdav>
DAV On
AuthType Basic
AuthName "webdav"
AuthUserFile /var/www/me.dav
Require valid-user
</Location>
最后一步:重启服务并登录吧!使用命令行cadaver进入登录
sudo /etc/init.d/apache2 restart
sudo apt-get install cadaver
cadaver http://127.0.0.1/webdav/
OVER.