Probiers mal mit folgendem Setup:

Config-Datei für den VirtualHost: `/etc/apache2/sites-available/cloud.example.com.conf`

```
<VirtualHost *:80>
    ServerName cloud.example.com
    Redirect permanent / https://cloud.example.com/
</VirtualHost>
<VirtualHost *:443>
    ServerName cloud.example.com
    RequestHeader unset X-Forwarded-Proto
    RequestHeader set X-Forwarded-Proto https env=HTTPS
    ErrorLog /var/log/apache2/cloud.example.com/error.log
    CustomLog /var/log/apache2/cloud.example.com/access.log combined
    SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/cloud.example.com/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/cloud.example.com/privkey.pem SSLCertificateChainFile /etc/letsencrypt/live/cloud.example.com/chain.pem
    Header always set Strict-Transport-Security "max-age=15768000"
    DocumentRoot /var/www/cloud.example.com
</VirtualHost>

# https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=apache-2.4.25&openssl=1.1.0f&hsts=yes&profile=modern

# modern configuration, tweak to your needs
SSLProtocol             all -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
SSLHonorCipherOrder     on
SSLCompression          off
SSLSessionTickets       off

# OCSP Stapling, only in httpd 2.3.3 and later
SSLUseStapling          on
SSLStaplingResponderTimeout 5
SSLStaplingReturnResponderErrors off
SSLStaplingCache        shmcb:/var/run/ocsp(128000)
```

Da du vmtl eine andere Apache/openssl Version hast (sudo apachectl -v/sudo openssl version), kannste dir den unteren Teil unter dem Mozilla-Link selber generieren.

Damit hast du alles konfiguriert, was du brauchst. Der erste VirtualHost ist für die Weiterleitung, der zweite kümmert sich um das eigentliche Hosten der Anwendung. `sudo a2enmod ssl` nicht vergessen. Das SSL-Zertifikat bekommst du von Letsencrypt, wie das geht, findest du auf https://certbot.eff.org

Am Ende dann `sudo a2ensite cloud.example.com` und ab dafür…


GM




Am 2018-07-12 10:46, schrieb René:
Hallo Liste,

Ich hab mir auf einem Bananapi Pro mit SATA Platte Nextcloud
installiert unter armbian - also einem Debian Derivat für raspberry &
Co.
So weit so gut - DynDNS Domäne ist auch angelegt - funktioniert auch
- derzeit noch abgeschalten / nicht aktiviert (Sicherheit)

Nextcloud funktioniert jetzt also im Heimnetz - derzeit noch mit http
Zugriff statt https.

Entsprechend (Tutorial) hab ich mir unter /etc/apache2/sites-enebled
eine nextcloud.conf eingerichtet.

Nextcloud [1] schreibt nun, dass für den HTTPS Zugriff eine virtual
Host´s Datei angelegt werden soll. Das hab ich kapiert. Was ich nicht
kapiere, ist, kann ich das

<VirtualHost *:80>
   ServerName cloud.nextcloud.com
   Redirect permanent / https://cloud.nextcloud.com/
</VirtualHost>
 und

<VirtualHost *:443>
  ServerName cloud.nextcloud.com
    <IfModule mod_headers.c>
      Header always set Strict-Transport-Security "max-age=15552000;
includeSubDomains"
    </IfModule>
 </VirtualHost>

(entsprechend abgeändert) direkt in meinen bestehende nextcloud.conf
reinschreiben ? Die sieht bisher so aus:

Alias /nextcloud "/var/www/html/nextcloud/"

<Directory /var/www/html/nextcloud/>
  Options +FollowSymlinks
  AllowOverride All

 <IfModule mod_dav.c>
  Dav off
 </IfModule>

 SetEnv HOME /var/www/html/nextcloud
 SetEnv HTTP_HOME /var/www/html/nextcloud

</Directory>

oder braucht es dazu eine weitere *.conf, die dann enabled werden muss
?

Danke !



Links:
------
[1]
https://docs.nextcloud.com/server/13/admin_manual/configuration_server/harden_server.html

Attachment: signature.asc
Description: OpenPGP digital signature

Antwort per Email an