Ich habe folgendes Problem, mein Apache soll unter der Adresse www.meineurl.de:80 , meineurl.de:80, meineurl.de:443 und subdomain.meineurl.de:443
Anfragen an www.meineurl.de:80 und meineurl.de:80 werden mittles .htaccess auf meineurl.de:443 weitergeleitet.
Das ganze Szenarion funktioniert wunderbar, allerdings nimmt der Server auch sämtliche Anfragen für blabla.meineurl.de:80 und blabla.meineurl:de:443
entgegen, was nicht sein soll.
Jetzt hab ich in der VHOST Doku gelesen dass per default immer der Erste Eintrag in der VHOST Datei ausgewählt wird, falls kein passender VHOST
gefunden wird.
Wie muss ein Default VHOST Eintrag aussehen welcher sämtliche Anfragen entgegennimmt welche nicht auf die oben genannten Domains abzielen ?
So wie es jetzt ist komme mit xyz.meineurl.de:80 und xyz.meineurl.de:443 immer auf den Inhalt von /var/www.
Ziel ist es dass alle "falschen"Anfragen ins leere laufen.
Meine VHOST sieht folgendermaßen aus.
- Code: Select all
<VirtualHost *:80>
ServerAlias *
DocumentRoot "/var/www/badurl/"
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/"
ServerName meineurl.de
ServerAlias www.meineurl.de
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/public/"
ServerName config.local
ServerAlias config.local
<Directory "/var/www/public/">
Order deny,allow
Deny from all
Allow from ::1 127.0.0.0/8
</Directory>
</VirtualHost>
Und hier die SSL VHOST Datei
- Code: Select all
Listen 443
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
SSLPassPhraseDialog builtin
SSLSessionCache "shmcb:/opt/lampp/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
<VirtualHost *:443>
DocumentRoot "/var/www/"
ServerName meineurl.de
ErrorLog "/opt/lampp/logs/error_log"
SSLEngine on
SSLCertificateFile "/opt/lampp/etc/certificates/cert.crt"
SSLCertificateKeyFile "/opt/lampp/etc/certificates/cert.key"
SSLCertificateChainFile "/opt/lampp/etc/certificates/extracert.crt"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/opt/lampp/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog "/opt/lampp/logs/ssl_request_log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
<VirtualHost *:443>
ServerName subdomain.meineurl.de
DocumentRoot "/var/www/public"
SetEnv APPLICATION_ENV "development"
SSLEngine on
SSLCertificateFile "/opt/lampp/etc/certificates/ee.crt"
SSLCertificateKeyFile "/opt/lampp/etc/certificates/ee.key"
SSLCertificateChainFile "/opt/lampp/etc/certificates/extracert.crt"
<Directory "/opt/lampp/htdocs/meineseite">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
Danke schonmal
Gruß Till