how to redirect/change the default vhost?

Discussion in 'Installation/Configuration' started by Ovidiu, Feb 7, 2012.

  1. Ovidiu

    Ovidiu Active Member

    I am running ISPCFG3 on Debian, all is well but I'd like to improve something:

    I have a wordpress multisite installation which is also running great but I would like to use a domain mapping plugin. This gives users of i.e. someblog.mydomain.tld the option of saving theirdomain.tld in their settings and setting up an A-record to my IP for theirdomain.tld to get the domain mapped to someblog.mydomain.tld automatically.

    Unfortunately since mydomain.tld isn't the default vhost I need to manually add their domain i.e. as an alias domain but if mydomain.tld would become the default vhost wordpress would handle this internally so hence the question: can I have a specific domain hosted on my server become the default vhost?

    Please let me know if I haven't made myself clear and I need to explain again?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The default vhost on a apache server is the one that is first in alphabetical order for a given IP address. With this knowledge, you can easiyl define a vhost to be the default by changing e.g. the domain name from 'domain.tld' to '000-domain.tld' and then add 'domain.tld' as subdomain to this vhost afterwards so that domain.tld is still assigned to it.
     
  3. Ovidiu

    Ovidiu Active Member

    Till, you are getting what I am asking for but I am still a bit confused. Have a look at this:

    - First of all, why do the enabled ones have numbers in front of them but not all?
    - Second, what I meant is the vhost called "default" as I think that is the one that gets called first.

    I.e. in the above example I gave, the guy who wanted to map the domain to one fo my subdomains simply set up an A-record pointing to my domain and in my ISPCFG3 panel I had not set up anything for this particular domain, so if I opened that URL, I was greeted by a generic: It Works! screen which I assumed was the default vhost.
    After I set up his alias domain to point to the domain where the mapping happened, everything worked smooth.

    Couldn't I simply (somehow) symlink 000-default to zice.ro.vhost? as that is the one I need?
    Or is it rather 000-apps.vhost that is the default one?
     
  4. Ovidiu

    Ovidiu Active Member

    excuse the accidental double post :-(
     
    Last edited: Feb 8, 2012
  5. Ovidiu

    Ovidiu Active Member

    @Till: can you please elaborate?
    Thanks.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Newer domains have numbers, the older ones will get a number when you edit them the next time.

    Please see my explanation in #2 how apache ahndles hosts and what the default vhost for apache is. For apache the alphabetical order ogf hosts matters in case that a given domain name does not exist.
     

Share This Page