Apache WebDAV (Linux): Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(→Testen) |
|||
Zeile 13: | Zeile 13: | ||
</pre> | </pre> | ||
== | == Konfiguration == | ||
<pre> | <pre> | ||
sudo mkdir /var/www/davtest/ | sudo mkdir /var/www/davtest/ | ||
sudo chown -R www-data:www-data /var/www/davtest/ | sudo chown -R www-data:www-data /var/www/davtest/ | ||
</pre> | |||
<pre> | |||
sudo htpasswd -c /var/www/davtest/passwd.dav <user> | |||
sudo chown root:www-data /var/www/davtest/passwd.dav | |||
sudo chmod 640 /var/www/davtest/passwd.dav | |||
</pre> | </pre> | ||
Zeile 25: | Zeile 31: | ||
<pre> | <pre> | ||
sudo | sudo vi davtest.conf | ||
</pre> | |||
<pre> | |||
<VirtualHost *:80> | |||
ServerName davtest.kirner.or.at | |||
ServerAlias davtest.local.kirner.or.at | |||
Redirect / https://davtest.kirner.or.at | |||
</VirtualHost> | |||
</pre> | |||
<pre> | |||
sudo vi davtest-ssl.conf | |||
</pre> | |||
<pre> | |||
<VirtualHost *:443> | |||
ServerName davtest.kirner.or.at | |||
ServerAlias davtest.local.kirner.or.at | |||
DocumentRoot /var/www/davtest/data | |||
SSLEngine on | |||
SSLCertificateFile /etc/ssl/certs/davtest.crt | |||
SSLCertificateKeyFile /etc/ssl/private/apache.key | |||
<Directory /var/www/davtest/> | |||
Options Indexes MultiViews | |||
AllowOverride None | |||
Order allow,deny | |||
allow from all | |||
DAV On | |||
AuthType Basic | |||
AuthName "martin" | |||
AuthUserFile /var/www/davtest/passwd.dav | |||
Require valid-user | |||
</Directory> | |||
ErrorLog ${APACHE_LOG_DIR}/davtest.kirner.or.at-error.log | |||
CustomLog ${APACHE_LOG_DIR}/davtest.kirner.or.at-access.log combined | |||
</VirtualHost> | |||
</pre> | </pre> | ||
Version vom 28. Januar 2018, 18:27 Uhr
Noch in Bearbeitung
Installation
sudo a2enmod dav sudo a2enmod dav_fs
sudo service apache2 restart
Konfiguration
sudo mkdir /var/www/davtest/ sudo chown -R www-data:www-data /var/www/davtest/
sudo htpasswd -c /var/www/davtest/passwd.dav <user> sudo chown root:www-data /var/www/davtest/passwd.dav sudo chmod 640 /var/www/davtest/passwd.dav
cd /etc/apache2/sites-available/
sudo vi davtest.conf
<VirtualHost *:80> ServerName davtest.kirner.or.at ServerAlias davtest.local.kirner.or.at Redirect / https://davtest.kirner.or.at </VirtualHost>
sudo vi davtest-ssl.conf
<VirtualHost *:443> ServerName davtest.kirner.or.at ServerAlias davtest.local.kirner.or.at DocumentRoot /var/www/davtest/data SSLEngine on SSLCertificateFile /etc/ssl/certs/davtest.crt SSLCertificateKeyFile /etc/ssl/private/apache.key <Directory /var/www/davtest/> Options Indexes MultiViews AllowOverride None Order allow,deny allow from all DAV On AuthType Basic AuthName "martin" AuthUserFile /var/www/davtest/passwd.dav Require valid-user </Directory> ErrorLog ${APACHE_LOG_DIR}/davtest.kirner.or.at-error.log CustomLog ${APACHE_LOG_DIR}/davtest.kirner.or.at-access.log combined </VirtualHost>
Testen
sudo apt-get install cadaver
cadaver https://davtest.<domain>
Links
https://www.techrepublic.com/article/how-to-enable-webdav-on-your-ubuntu-server/
https://httpd.apache.org/docs/2.4/mod/mod_dav.html
Zurück zu Ubuntu