Guten Abend,
nach folgender Anleitung habe ich mir einen kleinen Webserver eingerichtet: [Tutorial] Raspberry Pi als Webserver - Apache 2 Installation
Das hat auch alles gut geklappt und läuft soweit.
Nun möchte ich ein paar kleine Projekte auf dem Webserver installieren, um die Sicherheit etwas zu erhöhen möchte ich SSL nutzen. Hier stoß ich allerdings schon an meine Grenzen, da ich keine passende Anleitung im Netz gefunden hab.
Ein Zertifikat habe ich allerdings bereits erstellt.
Die Projekte sollen über eine DynDNS und auf dem Raspberry konfigurierte VirtualHosts erreichbar sein. Rufe ich den Webserver aus dem lokalen Netzwerk über https://[IP] bzw. https://[IP]/alias_P1 auf werde ich aufgefordert das Zertifikat zu bestätigen.
Rufe ich die Seite allerdings über die DynDNS https://[DynDNS] bzw. https://[DynDNS]/alias_P1 auf, passiert nichts, außer dass die Seite nach einem längeren Ladeversuch nicht erreichbar ist.
[Ergänzung] Der Aufruf über die DynDNS über HTTP funktioniert ebenfalls
Nach meiner Einschätzung liegt der Fehler an:
/etc/apache2/sites-available/default bzw. /etc/apache2/sites-available/default-ssl
ports.conf
NameVirtualHost *:80
Listen 80
<IfModule mod_ssl.c>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
In irgendeinem Beitrag habe ich dann gelesen, dass unter /etc/apache2 eine Datei httpd.conf liegen muss.
<VirtualHost *:443>
DocumentRoot /var/www
ServerName localhost
SSLEngine on
SSLCertificateKeyFile /etc/apache2/cert-ssl/zertifikat.key
SSLCertificateFile /etc/apache2/cert-ssl/zertifikat.crt
</VirtualHost>
Die default (unter /etc/apache2/sites-avaiable/) habe ich um die 2 Aliase (Ende der Datei) ergänzt:
<VirtualHost *:80>
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>
Alias /alias_P1 /var/www/Projekt1
<Location /alias_P1>
</Location>
Alias /alias_P2 /var/www/Projekt2
<Location /alias_P2>
DAV On
AuthType Basic
AuthName "dav"
AuthUserFile /var/www/Projekt2/pwd.dav
Require valid-user
</Location>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Alles anzeigen
Die default-ssl (unter /etc/apache2/sites-avaiable/) habe ich um die Aliase in dieser Form ergänzt:
<IfModule mod_ssl.c>
<VirtualHost _default_: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>
Alias /alias_P1 /var/www/Projekt1
<Location /alias_P1>
</Location>
Alias /alias_P2 /var/www/Projekt2
<Location /alias_P2>
DAV On
AuthType Basic
AuthName "dav"
AuthUserFile /var/www/Projekt2/pwd.dav
Require valid-user
</Location>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
SSLEngine on
SSLCertificateKeyFile /etc/apache2/cert-ssl/zertifikat.key
SSLCertificateFile /etc/apache2/cert-ssl/zertifikat.crt
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>
</IfModule>
Alles anzeigen
Hier komme ich nun nicht weiter und hoffe auf eure Unterstützung. Falls ich erforderliche Infos vergessen hab zu erwähnen, macht mich bitte darauf aufmerksam.
Vielen Dank
schönen Abend