vhosts by hostname, not ip

Discussion in 'Installation/Configuration' started by Dutchy, Nov 4, 2009.

  1. Dutchy

    Dutchy New Member

    I have to configure and fix an existing ISPConfig 3 install and I encountered the following problem:

    For all websites I create, vhosts are made in the form:
    <VirtualHost ip:port>
    This is wrong when it should be:
    <VirtualHost domain.example.com:port>
    I imagine this is a setting somewhere, but I have no idea where to look. I could obviously fix all these manually, but I hope somebody has a better idea?
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats not wrong, the setting ip:port is absolutely correct.
  3. Dutchy

    Dutchy New Member

    If it is correct, would you be so kind as to explain why this is correct?

    We have multiple domains pointing to the same IP and we want to run multiple sites on multiple (sub)domains. Coming from an Apache configs background myself, i would use VirtualHosts for this.

    I get the idea this is not the way ISPConfig works, but I don't quite understand what should be used to do this then.
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats the standard way in configuring it and ispconfig uses virtualhosts for this. In ISPConfig, either select the IP address for all sites or select * for all sites.

    See apache virtualhost documentation:


    you always use * or the IP address in the virtualhost directive and not the domain name. The domain name is used in the ServerName directive and thats exctly how ispconfig configures it.

    You should assiume that if a controlpanel is used many thousand hosting servers worldwide that it is able to configure virtualhosts then ;)
  5. Dutchy

    Dutchy New Member

    You are right, I should assume that :) (in most cases)

    I have things working now, after a manual graceful restart of apache, not sure why it did not work before. I only noticed that it does not work with *:80 but I don't care about that at this point.

Share This Page