Wildcard Subdomains on panel side

  • Hello Nuxwin


    Regarding to this topic (Wordpress Multisite richtig konfigurieren?), i would like to ask - if this can implemented into the Panel Configuration Site for Domains / Subdomains.


    As example: I will create an Subdomain like *.domain.tld and this will handle all coming Subdomains in one Directory like /var/www/virtual/user.tld/domain.tld/htdocs

    In fact i mean, this will automate such things, and customers can create there own "Wildcard - Subdomains" without asking the support to put a hand on the .conf files!
    Maybe you can also restrict it, that the reseller / administrator can allow this for special customers with one click.

    I think that this will be a great improvement for all I-MSCP Panel Users!
    Hopefully it´s understable described what i am talking about.

    If you need any other informations - Please let me know, i will try to catch all infos for you.

    Best regards

    Support Infos: I-MSCP Version: 1.5.x / Distro: Debian Stretch / PHP: 7.1.27 - FPM / I-MSCP Plugins: Let´s Encrypt + PHPSwitcher (latest Versions)

  • FloRet88


    If I understood well, you want a new option that make possible to enable wildcard entry for the domains and subdomains. Basically put, when the option is checked on, the generated vhost, here for a domain, would looks as follows:


    Code
    1. <VirtualHost <ip>:80>
    2. ServerAdmin [email protected]
    3. ServerName domain.tld
    4. ServerAlias www.domain.tld *.domain.tld
    5. DocumentRoot "/var/www/virtual/domain.tld/htdocs"
    6. ...
    7. </VirtualHost>

    Right?


    Of course, it should be easy to do that as long as you're not asking me to manage/detect possible conflicts between various vhosts. For instance, let's imagine the following scenario:


    One customer do the following:

    1. Create the domain.tld domain with the wildcard option enabled
    2. Create the sub.domain.tld

    Then this would produce the following vhosts:


    Code
    1. <VirtualHost <ip>:80>
    2. ServerAdmin [email protected]
    3. ServerName domain.tld
    4. ServerAlias www.domain.tld *.domain.tld
    5. DocumentRoot "/var/www/virtual/domain.tld/htdocs"
    6. ...
    7. </VirtualHost>


    Code
    1. <VirtualHost <ip>:80>
    2. ServerAdmin [email protected]
    3. ServerName sub.domain.tld
    4. ServerAlias www.sub.domain.tld
    5. DocumentRoot "/var/www/virtual/domain.tld/sub/htdocs"
    6. ...
    7. </VirtualHost>


    The problem here is that both vhost would collide. I don't remember if there is a precedence for apache when an alias entry such as *.domain.tld has been added in one vhost and that another vhost collides with it such as sub.domain.tld. The best thing would be that if there is a non-wildcard entry such as sub.domain.tld, that one take precedence over the *.domain.tld wildcard entry. The behavior need to be checked. As far as I known, precedence for apache2 is based on natural sorting rather than entry matching type. I need to check that. That why I say, I can implement that feature easily as long as you don't ask me to manage possible conflicts. My thinking is that a customer should be smart enough to not create any subdomain if the wildcard option is enabled for the parent domain.


    If you agreed, I can add that feature today, else, we need postpone...


    See also

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Nuxwin

    Added the Label wait for reply
  • Why don't you just use a shared mount point on your subdomains ? The customers don't need to contact support for that.


    Example:

    - primary domain xxxyyyzzz.com -> /var/www/virtual/xxxyyyzzz.com/htdocs

    - subdomain de.xxxyyyzzz.com -> xxxyyyzzz.com

    - subdomain fr.xxxyyyzzz.com -> xxxyyyzzz.com

    - subdomain it.xxxyyyzzz.com -> xxxyyyzzz.com

    and so on...

  • Good morning,


    He do not want this option because, as he said, he do not want to have to configure each subdomain through the control panel. I think that what he want is as follows:

    1. Create the domain.tld domain with the *.domain.tld wildcard entry option
    2. Create has many sites through wordpress, without having to deal with the control panel. I think that he want only give access to wordpress to its end-users.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Hello @ all!

    Thanks for your response Nuxwin !

    You correctly understand everything what i suggested! I also understand, that it´s not possible to handle all possible conflicts!

    I am fine with your solution.

    Best regards.

    Support Infos: I-MSCP Version: 1.5.x / Distro: Debian Stretch / PHP: 7.1.27 - FPM / I-MSCP Plugins: Let´s Encrypt + PHPSwitcher (latest Versions)

  • FloRet88


    Will be part of i-MSCP version. Implementation almost finished ;) I'll do the announcement on my fb, as always. Thank you for the idea. That's much appreciated.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Nuxwin

    Set the Label from wait for reply to Implemented
  • Nuxwin

    Closed the thread.