Apache WebDAV (Linux): Unterschied zwischen den Versionen

Aus Tutorials
Zur Navigation springen Zur Suche springen
Zeile 36: Zeile 36:
<pre>
<pre>
<VirtualHost *:80>
<VirtualHost *:80>
         ServerName davtest.kirner.or.at
         ServerName davtest.<domain>
         ServerAlias davtest.local.kirner.or.at
         ServerAlias davtest.<domain>
         Redirect / https://davtest.kirner.or.at
         Redirect / https://davtest.<domain>
</VirtualHost>
</VirtualHost>
</pre>
</pre>
Zeile 48: Zeile 48:
<pre>
<pre>
<VirtualHost *:443>
<VirtualHost *:443>
     ServerName davtest.kirner.or.at
     ServerName davtest.<domain>
     ServerAlias davtest.local.kirner.or.at
     ServerAlias davtest.local.<domain>


     DocumentRoot /var/www/davtest/data
     DocumentRoot /var/www/davtest/data
Zeile 71: Zeile 71:
     </Directory>
     </Directory>


     ErrorLog ${APACHE_LOG_DIR}/davtest.kirner.or.at-error.log
     ErrorLog ${APACHE_LOG_DIR}/davtest.<domain>-error.log
     CustomLog ${APACHE_LOG_DIR}/davtest.kirner.or.at-access.log combined
     CustomLog ${APACHE_LOG_DIR}/davtest.<domain>-access.log combined
</VirtualHost>
</VirtualHost>
</pre>
</pre>

Version vom 28. Januar 2018, 18:39 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.<domain>
        ServerAlias davtest.<domain>
        Redirect / https://davtest.<domain>
</VirtualHost>
sudo vi davtest-ssl.conf
<VirtualHost *:443>
    ServerName davtest.<domain>
    ServerAlias davtest.local.<domain>

    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.<domain>-error.log
    CustomLog ${APACHE_LOG_DIR}/davtest.<domain>-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