WebDAV unter Ubuntu /Apache

Aus xinux.net
Zur Navigation springen Zur Suche springen

Apache2 installieren

apt-get install apache2

SSL Zertifikat erstellen

mkdir -p /etc/apache2/ssl
openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.pem
ln -sf /etc/apache2/ssl/apache.pem /etc/apache2/ssl/`/usr/bin/openssl x509 -noout -hash < /etc/apache2/ssl/apache.pem`.0
chmod 600 /etc/apache2/ssl/apache.pem

Benutzer und Passwort für Webzugriff erstellen

htpasswd -c /etc/apache2/htpasswd xinux
password: *****

Überprüfen ob Port 443 aktiviert ist

cat /etc/apache2/ports.conf

Module aktivieren

a2enmod ssl dav*

Verzeichnis erstellen

mkdir /var/webdav
chown www-data:www-data /var/webdav

Seite aktivieren

a2ensite default-ssl

Zugriff von außen

  • Linux

z.B. mit Konqueror: webdavs://192.168.242.11/webdav/ in Adressleiste eingeben

  • MSIE 6

Datei -> öffnen -> https://192.168.242.11/webdav und Checkbox "Als Webordner öffnen" aktivieren

  • Windows allgemein:

Netzwerkumgebung -> Netzwerkressource hinzufügen -> https://192.168.242.11/webdav angeben

  • Windows Vista

Start -> Ausführen -> Regedit

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters

BasicAuthLevel auf 2 setzen -> Ok

Beenden und neustarten.


Softwareupdate für Webordner (KB907306) installieren

http://www.microsoft.com/downloads/details.aspx?displaylang=de&FamilyID=17c36612-632e-4c04-9382-987622ed1d64

Dann Computer -> Rechte Maustaste -> Netzwerkressource hinzufügen -> Weiter -> Weiter -> https://192.168.242.11/webdav eingeben -> Weiter -> Zugangsdaten eingeben.

  • Reiner Lesezugriff ist mit jedem Browser möglich

Listings

/etc/apache2/ports.conf:

NameVirtualHost *:80
Listen 80
<IfModule mod_ssl.c>
   # SSL name based virtual hosts are not yet supported, therefore no
   # NameVirtualHost statement here
   Listen 443
</IfModule>

/etc/apache2/sites-available/default-ssl:

<IfModule mod_ssl.c>
<VirtualHost *:443>
       ServerAdmin webmaster@localhost
       DocumentRoot /var/www/
       <Directory />
               Options FollowSymLinks
               AllowOverride None
       </Directory>
       <Directory /var/www/>
               Options Indexes FollowSymLinks MultiViews
               AllowOverride None
               Order allow,deny
               allow from all
       </Directory>
       ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
       <Directory "/usr/lib/cgi-bin">
               AllowOverride None
               Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
               Order allow,deny
               Allow from all
       </Directory>
       ErrorLog /var/log/apache2/error.log
 CustomLog /var/log/apache2/ssl_access.log combined
       Alias /doc/ "/usr/share/doc/"
       <Directory "/usr/share/doc/">
               Options Indexes MultiViews FollowSymLinks
               AllowOverride None
               Order deny,allow
               Deny from all
               Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
       Alias /webdav "/var/webdav/"
       <Directory "/var/webdav/">
       DAV on
       Options Indexes
       AuthType Basic
       AuthName "Mein WebDAV"
       AllowOverride None
       AuthUserFile /etc/apache2/htpasswd
       Require valid-user
       </Directory>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
<FilesMatch "\.(cgi|shtml|phtml|php)$">
               SSLOptions +StdEnvVars
       </FilesMatch>
       <Directory /usr/lib/cgi-bin>
               SSLOptions +StdEnvVars
       </Directory>
BrowserMatch ".*MSIE.*" \
               nokeepalive ssl-unclean-shutdown \
               downgrade-1.0 force-response-1.0
</VirtualHost>
</IfModule>

Vorlage:HOWTO