How Subdomain works (for documentation)

Discussion in 'Developers' Forum' started by moglia, Aug 19, 2009.

  1. moglia

    moglia New Member

    :confused: I will starts produce of end user documentation anyone can explain how subdomain works im looking at apache alias points subdomain for the same document root of main site.

    Host
    DOMAIN
    REDIRECT TYPE - No Redirect - No Flag - R - L - R,L
    PATH

    Active - Y

    I need explanations how REDIRECT TYPE works.
    it´s possible create a independent virtualhost for subdomain?
    (see workarround)

    How subdomain can use another document root.

    domain inclusion creates folders: cgi-bin log ssl tmp web

    subdomain can use a folder like: subdomain name?

    at the same level of web (document root)

    cgi-bin log ssl tmp web subdomain

    The main question is can specify another document root for subdomain?

    If not possible specify a subdomain document root i no see any diferences between server alias and subdomain.

    i think alias can redirect one domain to another using virtual redirect. one domain to another.

    My workarround i created subdomain as independent website.

    My idea is create subdomain with another document root with the same virtual hosting settings. share setting (main domain and subdomain).
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    This is no workaround, it is the intended way of doing it. If you want a website, create a website. It does not matter for a website if a domain is a.com a.a.com or a.a.a.com

    The difference is very easy. An alias domain can be any domain while a subdomain can just be a subdomain. This is a often requested feature and separation from hosters as many of them allow free subdomains but not free alias domains.
     
  3. trondhuso

    trondhuso Member

    To make it even more obvious:
    With an alias you can do this:
    main domain: example.com
    alias: example.net (will point to example.com)
    alias: example.org (will point to example.com)
    alias: domain.com (will point to example.com)

    To till:
    What people are reacting to is how subdomains are created.
    Example:
    (probably a typical one): blog.domain.com
    The way ISP Config 3 wants us to do this by using the sub-domain menu, it will actually be the same as: www.domain.com/blog
    Which sometimes is OK, unless you would like to have a subdomain like test.domain.com where you want to test your application with a different setting.
    In Plesk they do it like this:
    directory-structure:
    -domain.com
    --web
    --subdomain
    ----test
    ------web
    And the information regarding the subdomain is found in the vhost-file for the domain.

    You should probably ask users how they implement sub domains. if it is the www.domain.com/test eq test.domain.com then do no changes.
    If it is that people go and create a new website as test.domain.com, then I would consider changing the way ISP Config handles sub domains.
    I for one support the latter as I am often testing out client websites in a sub domain (client.domain.com) before putting them into production (www.client.com).
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    There is absolutely no need to change the way ispconfig handles subdomains as you just created the subdomain the wrong way. If you like to have a separate directory for a subdomain, you simply click on new website, enter sub.domain.com into the domain field and click on save.

    If you want to test a website before you put it in production, you just click on new website, enter test.cdomain.com into the domain field and click on save. If the site shall go live, you edit the website settings and change test.domain.com to domain.com abd click on save. Thats all.
     
  5. we_are_borg

    we_are_borg New Member

    Till if i make a subdomain as a new website i will get the desired effect namely domain.tld and subdomains.domain.tld all with different logins and pass as a bonus. But would this system not break Ajax requests or will Ajax see it as one domain even its split up.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess the way a subdomain gets implemented in apache has no influence on ajax, as the client does not know if a subdomain is redirected by a rewrite rule or if its a separate vhost.
     
  7. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    A question regarding this "subdomains" thing has just come up...

    The situation is as follows:
    Clients have 1 Domain mydomain.com and they shall NOT be able to add further domains like mysecond.com to their ispc account - so I have to limit the web-domain thing to 1.
    BUT: The clients shall be able to add subdomains like happywith.mydomain.com with separate login data and root path.
    This is not possible with the Subdomain function of ispc and as the website limit is set to 1 - not possible with the add website function either.
    If I raise the website limit to 5 to allow such subdomains - users could add external domains to their account.

    Is there any solution for this?
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    In SVN you find a domain module which allos to restrict the domains for websites by the admin user.
     

Share This Page