====== Die Konfiguration von Apache2 für eine Nextcloud Instanz ======
Im folgenden wird eine HTTPS Konfiguration für einen Aapache2 Webserver aufgezeigt:
Zeilen welche mit "# PLEASE CHANGE" enden, müssen bearbeitet werden!
/etc/{apache2/httpd}/conf.d/nextcloud.conf
SSLEngine on
DocumentRoot /var/www/nextcloud/
ServerName nextcloud.nikomax.de # PLEASE CHANGE
Protocols http/1.1
LoadModule remoteip_module modules/mod_remoteip.so
RemoteIPHeader X-Forwarded-For
RemoteIPTrustedProxy 10.0.10.1 # PLEASE CHANGE
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
#Header edit Set-Cookie ^(.*)$ "$1;HttpOnly;Secure;SameSite=Strict"
SSLOptions +StdEnvVars
SetHandler proxy:fcgi://php-fpm
# we must declare a parameter in here (doesn't matter which) or
# it'll not register the proxy ahead of time
ProxySet disablereuse=off
# Note: If you configure php-fpm to use the "pm = ondemand"
#then use "ProxySet disablereuse=on"
#Alias /nextcloud "/var/www/nextcloud/"
ProxyPass /push/ws ws://127.0.0.1:7867/ws
ProxyPass /push/ http://127.0.0.1:7867/
ProxyPassReverse /push/ http://127.0.0.1:7867/
Options +FollowSymlinks
AllowOverride All
Require all granted
Dav off
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
ErrorLog /var/log/httpd/nextcloud_error.log
CustomLog /var/log/httpd/nextcloud_access.log combined
# ServerAlias nextcloud.bitbone.de **# PLEASE CHANGE and UNCOMMENT IF NEEDED**
SSLCertificateFile /etc/pki/tls/certs/nextcloud.crt
SSLCertificateKeyFile /etc/pki/tls/private/nextcloud.key
Falls nur diese Konfiguration vorgenommen wird, ist der Server nur per HTTPS erreichbar. Das heißt eine unverschlüsselte Verbindung per HTTP wird auf der Standard-Apache2 Seite landen oder gar nichts anzeigen!