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.
     

Share This Page