habe einen Vodafone Kabel Business Anschluss mit fester IP, also dachte ich mir, kann ich meine Website auch darüber in einer DMZ hosten. Apache2 installiert, vhost Konfig erstellt, dann via Letsencrypt Zertifikat geholt. Alles gut soweit. Nun wollte ich das gleiche für eine 2. Domain auf dem gleichen Server machen, also wieder vhost konfig erstellt, via a2ensite enabled, aber noch kein LetsEncrypt. Rufe ich die 2. Domain im Browser auf ( egal welcher) dann findet immer ein redirect auf die erste Domain via SSL statt. Hier mal meine Konfigs:
Domain1:
Code: Alles auswählen
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerAdmin postmaster@domain.net
DocumentRoot /var/www/html/domain1/
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
RewriteEngine on
RewriteCond %{SERVER_NAME} =domain1.de [OR]
RewriteCond %{SERVER_NAME} =www.domain1.de
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
Code: Alles auswählen
<IfModule mod_ssl.c>
<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerAdmin postmaster@domain.net
DocumentRoot /var/www/html/domain/
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
ServerName www.domain.de
Include /etc/letsencrypt/options-ssl-apache.conf
ServerAlias domain.de
SSLCertificateFile /etc/letsencrypt/live/www.domain.de/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.domain.de/privkey.pem
</VirtualHost>
</IfModule>
Domain2:
Code: Alles auswählen
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
servername domain2.gratis
ServerAlias www.domain2.gratis
ServerAdmin postmaster@domain1.net
DocumentRoot /var/www/html/domain2.gratis
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
Hier die aktivierten Sites:
Code: Alles auswählen
lrwxrwxrwx 1 root root 36 Aug 7 19:53 002-domain1.conf -> ../sites-available/002-domain1.conf
lrwxrwxrwx 1 root root 53 Aug 19 18:12 002-domain1-le-ssl.conf -> /etc/apache2/sites-available/002-domain-le-ssl.conf
lrwxrwxrwx 1 root root 40 Sep 3 15:02 003-domain2.gratis.conf -> ../sites-available/003-domain2.gratis.conf
Puh, keine Ahnung was los ist. Im DNS hab ich jeweils @ auf die Vodafone IP und www als Host A ebenfalls auf die IP. Von der Vodafone Fritzbox habe ich Port80 und 443 an meine Pfsense weitergeleitet. Dahinter ist die u.A. DMZ
Wer hat einen Tipp für mich?
ciao, heinzelrumpel