Ubuntu: WebDAV-palvelimen määrittäminen - miten se toimii
Voit helposti määrittää WebDAV-palvelimen Ubuntu-palvelimelle. Tässä käytännöllisessä kärjessä me näytämme sinulle tarkalleen kuinka tämä tehdään.
Asenna WebDAV-palvelin Ubuntuun - niin se toimii
- Kirjaudu sisään Linux-palvelimeen SSH: lla ja kirjoita komento "sudo a2enmod dav sudo a2enmod dav_fs" ja vahvista kirjoittamasi näppäimellä [Enter].
- WebDAV: lle luodaan sopiva hakemisto käyttämällä "sudo mkdir / var / webdav". Sitten sinun on käytettävä "sudo chown -R www-data: www-data / var / webdav" kansioiden käyttöoikeuksien säätämiseen.
- Nyt joitain muutoksia tarvitaan editorissa. Lataa vastaava tiedosto komennolla "sudo nano / etc / apache2 / site-enabled / 000-default.conf" editoriin ja lisää seuraavat rivit "Virtual Horst" -sovelluksen kautta: "Valinnat Hakemistot MultiViews AllowOverride Ei mitään Tilaa salli "Estä sallia kaikista".
- Tee nyt kappale ja lisää toinen: "Alias / webdav / var / webdav / DAV-valikossa Asetukset + Hakemistot AuthType Basic AuthName DAV AuthUserFile / etc / apache2 / webdav Vaadi kelvollinen käyttäjä". Muutokset tallennetaan näppäinyhdistelmällä [Ctrl] + [O]. Sitten paina [Ctrl] + [X] poistuaksesi editorista.
- Turvallisuuden vuoksi sinun on luotava erillinen käyttäjä WebDAV: lle. Voit tehdä tämän "sudo htpasswd -c / etc / apache2 / webdav name" -sovelluksella. Mukauta "Nimi" haluamallasi käyttäjän nimellä. Tämän jälkeen sinun on annettava vastaava salasana kahdesti.
Muut vaiheet: Asenna WebDAV-palvelin Ubuntuun
- Turvallisuussyistä suosittelemme salaamaan WebDAV-palvelimesi, muuten sisältö siirretään suojaamattomana.
- SSL on sopiva tähän menettelyyn. Lataa itsesi komennolla "openssl genrsa -out /etc/ssl/private/apache.key 2048 openssl req -new -x509 -key /etc/ssl/private/apache.key -days 365 -sha256 -out / etc / ssl / certs / apache.crt "palvelimellesi sopiva SSL-varmenne.
- Jotta salaus toimisi, sinun on aktivoitava SSL-toiminto komennolla "sudo a2enmod ssl".
- Tee nyt varmuuskopio tiedostosta "/ etc / apache2 / sites-available / 000-default.conf". Avaa sitten se "nano / etc / apache2 / siteavable / webdav-ssl.conf" ja säädä "" "kohtaan" ".
- Alla on myös lisättävä "SSLEngine on SSLCertificateFile / etc / ssl / certs / apache.crt SSLCertificateKeyFile /etc/ssl/private/apache.key", jotta salaus otetaan käyttöön.
- Käynnistä lopuksi verkkopalvelin uudelleen "sudo service apache2 restart" -sovelluksella. Laite kytketään sitten.
Seuraavassa käytännöllisessä vinkkiämme osoitamme sinulle, kuinka voit käyttää WebDAV-sovellusta Androidilla.