apache2vhostsispconfig

Apache2 default host not served - ispconfig


I've run across the following issue with my ISPconfig/apache2 Setup:

my default host 000-default is not being served. When I enter the server-ip, the Server hostname into my browser, the Server is serving a Domain Name that starts with a number.

My /etc/apache2/sites-enabled Folder Looks as follows: sites-enabled

I ran apache2ctl -S and it told me, the Domain starting with 3xxx is the Default host:

188.68.40.181:443      is a NameVirtualHost
     default server 3xxxxxxxx.de (/etc/apache2/sites-enabled/100-3xxxxxxxx.de.vhost:109)
     port 443 namevhost 3xxxxxxxx.de (/etc/apache2/sites-enabled/100-3xxxxxxxx.de.vhost:109)
             alias www.3xxxxxxxx.de
     port 443 namevhost dxxxx.de (/etc/apache2/sites-enabled/100-dxxxx.de.vhost:93)
             alias www.dxxxx.de
     port 443 namevhost jxxxxxx.de (/etc/apache2/sites-enabled/100-jxxxxxx.de.vhost:130)
             alias www.jxxxxxx.de
     port 443 namevhost lxx.dxxxx.de (/etc/apache2/sites-enabled/100-lxx.dxxxx.de.vhost:124)
     port 443 namevhost lxxxxxx.dxxxx.de (/etc/apache2/sites-enabled/100-lxxxxxx.dxxxx.de.vhost:100)
188.68.40.181:80       is a NameVirtualHost
     default server 3xxxxxxxx.de (/etc/apache2/sites-enabled/100-3xxxxxxxx.de.vhost:7)
     port 80 namevhost 3xxxxxxxx.de (/etc/apache2/sites-enabled/100-3xxxxxxxx.de.vhost:7)
             alias www.3xxxxxxxx.de
     port 80 namevhost dxxxx.de (/etc/apache2/sites-enabled/100-dxxxx.de.vhost:7)
             alias www.dxxxx.de
     port 80 namevhost jxxxxxx.de (/etc/apache2/sites-enabled/100-jxxxxxx.de.vhost:7)
             alias www.jxxxxxx.de
     port 80 namevhost lxx.dxxxx.de (/etc/apache2/sites-enabled/100-lxx.dxxxx.de.vhost:7)
     port 80 namevhost lxxxxxx.dxxxx.de (/etc/apache2/sites-enabled/100-lxxxxxx.dxxxx.de.vhost:7)
     port 80 namevhost txxxxx.dxxxx.de (/etc/apache2/sites-enabled/100-txxxxx.dxxxx.de.vhost:7)
*:8081                 server1.xxxxxxxxxxx.com (/etc/apache2/sites-enabled/000-apps.vhost:9)
*:80                   server1.xxxxxxxxxxx.com (/etc/apache2/sites-enabled/000-default.conf:2)
*:8080                 server1.xxxxxxxxxxx.com (/etc/apache2/sites-enabled/000-ispconfig.vhost:9)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl
Mutex mpm-accept: using_defaults
Mutex fcgid-pipe: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex authdigest-client: using_defaults
Mutex fcgid-proctbl: using_defaults
Mutex ssl-stapling: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
Define: MODPERL2
Define: ENABLE_USR_LIB_CGI_BIN
User: name="www-data" id=33
Group: name="www-data" id=33

To my understanding, 000-default.conf should be the Default vhost, because it is first in alphabetical order.

The 000-default.conf Looks as follows:

<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 www.example.com

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html


# 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

</VirtualHost>

Does anyone have a clue, why die 000-default.conf is being ignored?


Solution

  • 000-default.conf is only the default for *:80, but you've also defined virtual hosts on specific interfaces/IP addressses (I am not sure if you meant to obfuscate them, so I will not quote them here).

    Each "set" of name-based vhosts has a default. All vhosts with *:80 are one set, and each with 1.2.3.4:80 are another.

    Apache will never look at the names in *:80 vhosts once there is an exact match at the IP/interface layer with the specific vhosts.