NameVirtualHost and IP issue

Discussion in 'Developers' Forum' started by ispcomm, Nov 11, 2016.

  1. ispcomm

    ispcomm Member

    Hi,
    I discovered an issue with the new 3.1.1 and apache2 namevirtualhost.
    If a "reseller" can add sites to a shared server there's a drop-down to select the IP of the server. By default it is '*', but ispconfig allows to select one of the ip addresses of the web server.
    When the specific IP is selected, there's no check if the ip is used by other '*' sites. The resulting config will redirect all sites on this server to the first site that specifies an IP address.
    That is because when '*' is selected, the config in apache looks like this:
    <VirtualHost *:80>...
    with a specified ip it looks like this:
    <VirtualHost a.b.c.d:80> ...
    And this host takes precedence over all other name virtual hosts.
    I think that either we need a check to prevent this situation, or a select box to prevent a reseller from using the IP selection at all.
    ispcomm.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    an IP can only be selected if you set this IP to be generally available for all users. If you set an IP to be available only fr one client, then this IP can be used only by this client. and If you don't want clients or resellers to be able to select IP addresses (as most users are doing it), then don#t add them under System > Server IP.
     
  3. ispcomm

    ispcomm Member

    I see what you're saying. The IP was added automatically when this new web server was added to a multiserver installation. It was automatically made available to all users. One of them changed the default '*' to the IP address of the server, taking down all other virtual hosts.
    I'd suggest a better default would be not adding the IPs available to all by default, but took note now.
    Thank you.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    As far as I know, ispconfig is not adding any IP's automatically to the list. At least this does not happen on my servers. But I will check that.
     
  5. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    We just ran into that too, a customer selected their ip addr from the list and took all other sites down. It's possible I added those ip addrs manually, but definitely worth making sure that doesn't happen by default.

    On a vaguely related note, it is useful to have the ip listed at the correct server as a suggested ip when adding a dns zone. (almost every address listed as a suggestion is useless for most customers, it's just stuff other customers have entered themselves - the one really useful thing was knowing that a specific ip address is on the web server...)

    That last issue of many useless addresses in the suggested ip box was mentioned in https://git.ispconfig.org/ispconfig/ispconfig3/issues/2587 but marked as closed/implemented - maybe a regression in more recent 3.1?
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    The issue report is about taking IP addresses from the fields xfer, also_notify and update_acl of a dns zone. are you sure that the IP addresses that you see in the list exist only in these threee fields?
     
  7. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    No, they not from those fields, just what other client's have entered in dns records. I'll file an rfe for that.
     

Share This Page