Default apache behavior not working

Discussion in 'Installation/Configuration' started by fbarcenas, May 12, 2015.

  1. fbarcenas

    fbarcenas Member

    I have the default site enable in a2ensite.. If I go the IP I see the index.html with the disabled site message I placed in it.

    When I disable a site ON A VIRTUAL IP(eth0:0, eth0:1,etc) and visit the IP ADDRESS OR DISABLED DOMAIN, you do not see the default site, you see another client on the same IP.
    When I disable a site that is USING THE PRIMARY IP(eth0) it works fine and you get default sites index.html.
    I tried adding
    NameVirtualHost *
    to /etc/apache2/sites-available/default and restarted the server but to no avail, it still has the same behaviour on the VIRTUAL IPS.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    What you describe above is the default behaviour of apache. An IP address is always a sronger match then a wildcard, so apache must show the first site that it finds on the IP instead of the default website. the default website will only be used when your websites use * and not the Ip address for the vhosts. If you use an IP, then you have to create a default vhost for that IP:

    1) Add a new website in ispconfig with domain name 000-default.tld
    2) Select the IP address in the IP field where this website shall be the default one.
     
  3. fbarcenas

    fbarcenas Member

    That solution only works for the last 000-default.tld I create for an IP:
    for example:
    192.168.1.1 (primary)
    192.168.1.2 (virt eth0:0) 000-default.tld *this one stops working as soon as I create the next one.
    192.168.1.3 (virt eth0:1) 000-default.tld

    Try creating a 000-default.tld for each virtual IP and you will see that it does not work.
     
  4. fbarcenas

    fbarcenas Member

    It seems if I label the following 001-default.tld and 002-default.tld and so on it all works fine.
     

Share This Page