[Gelöst] Apache2 und VirtualHosts

Debian macht sich hervorragend als Web- und Mailserver. Schau auch in den " Tipps und Tricks"-Bereich.
Antworten
Benutzeravatar
TheRealKingS
Beiträge: 16
Registriert: 28.02.2013 09:58:11
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: Simmerath
Kontaktdaten:

[Gelöst] Apache2 und VirtualHosts

Beitrag von TheRealKingS » 24.01.2015 19:57:06

Hallo zusammen,

trotz googlen und suchen fand ich keine Lösung für mein Problem. Sobald ich den apache2 neustarte, bekomme ich folgende Ausgabe auf der Konsole:

Code: Alles auswählen

[....] Restarting web server: apache2
[Sat Jan 24 19:36:40 2015] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sat Jan 24 19:36:40 2015] [error] VirtualHost *:80 -- mixing * ports and non-*ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sat Jan 24 19:36:40 2015] [error] VirtualHost *:80 -- mixing * ports and non-*ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sat Jan 24 19:36:40 2015] [error] VirtualHost *:80 -- mixing * ports and non-*ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sat Jan 24 19:36:40 2015] [error] VirtualHost *:80 -- mixing * ports and non-*ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sat Jan 24 19:36:40 2015] [error] VirtualHost *:80 -- mixing * ports and non-*ports with a NameVirtualHost address is not supported, proceeding with undefined results
[...]
[Sat Jan 24 19:36:42 2015] [error] VirtualHost *:80 -- mixing * ports and non-*ports with a NameVirtualHost address is not supported, proceeding with undefined results
. ok
Ganz klar ist, dass mein Apache nicht mit den verschiedenen VHost Konfigurationen klar kommt. Habe Websiten sowohl auf 443 als auch auf 80 laufen. Meine ports.conf:

Code: Alles auswählen

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz

NameVirtualHost *
Listen 80

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.
    NameVirtualHost *:443
    Listen 443
</IfModule>
Änder ich das erste "NameVirtualHost" auf "*:80", bekomme ich folgende Ausgabe beim neustarten:


Und keine Website oder Subdomain ist mehr erreichbar.

Ausgabe von apachectl -S bei *:80 :


Und bei * :


Ich weiß echt nicht mehr weiter (Domains dürfen im Klartext stehen, sind ja meine). Ach ja, Aufbau einer der VHost Konfigurationen:

Code: Alles auswählen

<VirtualHost *:80>
        ServerAdmin stephan@krinetzki.de
        ServerName krinetzki.de
        ServerAlias www.krinetzki.de
        ServerAlias ipv4.krinetzki.de
        ServerAlias ipv6.krinetzki.de
        ServerAlias *.krinetzki.de
        # Indexes + Directory Root.
        DirectoryIndex index.php index.htm index.html
        DocumentRoot /var/www/krinetzki.de/httpdocs
        <Directory /var/www/krinetzki.de/httpdocs>
          Options Indexes FollowSymLinks
          AllowOverride All
          Order Allow,Deny
          Allow from All
        </Directory>

        # Logfiles
        CustomLog /var/log/apache2/krinetzki.de_access_log combined
        ErrorLog /var/log/apache2/krinetzki.de_error_log

        ServerSignature Off

</VirtualHost>
System ist ein Debian Wheezy Virtual Server bei Hosteurope. Ich hoffe, ein Apache Guru kann mir sagen, wie ich die Meldung weg kriege


Vielen Dank für eure Hilfe

Stephan

P.S: Und bitte auch erläutern, warum. Damit ich das lerne :D
Zuletzt geändert von TheRealKingS am 25.01.2015 18:05:42, insgesamt 1-mal geändert.

Benutzeravatar
4A4B
Beiträge: 981
Registriert: 09.11.2011 11:19:55
Kontaktdaten:

Re: Apache2 und VirtualHosts

Beitrag von 4A4B » 24.01.2015 20:22:42

Mögliche Ursachen für diese Fehlermeldungen sind auf dieser Seite des Httpd Wikis aufgeführt:

https://wiki.apache.org/httpd/VirtualHostsMixingPorts

2. bedeutet, dass sowohl beide NameVirtualHost Direktiven als auch ausnahmslos alle (aktivierten) <VirtualHost> Container eine Port-Angabe benötigen.

Benutzeravatar
TheRealKingS
Beiträge: 16
Registriert: 28.02.2013 09:58:11
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: Simmerath
Kontaktdaten:

Re: Apache2 und VirtualHosts

Beitrag von TheRealKingS » 25.01.2015 18:05:24

Hallo 4A4B,

habe es nun behoben. Habe in der ports.conf nun NameVirtualHost *:80 eingetragen, die default und default-ssl aktiviert, dort jeweils in die Config <VirtualHost _default_:80> respektive <VirtualHost _default_:443> eingetragen und Probleme behoben. Nun läuft der Apache so, wie er soll.

Vielen Dank für deine Hilfe :)

Antworten