Guidance needed for setting up a subdomain, please

Discussion in 'Installation/Configuration' started by manarak, Jun 17, 2009.

  1. manarak

    manarak Member

    Hi, I searched the forum, but I found nothing that was very clear on how to achieve the following:

    I have a site domain.com

    I have a /subdomain directory inside /web, like this: /web/subdomain

    I want subdomain.domain.com to point to /web/subdomain, /web/subdomain being new root dir for the site on the subdomain.

    I want to access all files with the same FTP user.


    Thanks!

    P.S. I tried to setup a subdomain by just setting up a site for it and then added a DNS zone with the wizard if it were a different site, but it doesn't seem to work:
    While the subdomain works correctly, the content of the subdomain is shown on the main domain instead of the main domain's content.
     
  2. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Just use the redirect function and set the redirect path to /subdomain/ and the type to L.
     
  3. manarak

    manarak Member

    hmm... the path would be the server path, like /var/www/... etc?
     
  4. manarak

    manarak Member

    and what should I do with the DNS zone?

    I would like to know exactly what to do.
     
  5. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    No, not the server path. Just the path inside the web.
    DNS Zone? Same as the main zone for this website.
     
  6. manarak

    manarak Member

    so, I don't need to create a DNS Zone for the subdomain, right?

    So the process would be:

    1- create a site standard normally, domain.com
    2- inside that site, create a /subdomain/ subfolder
    3- create a new site on ISPC, with domain subdomain.domain.com
    4- setup an "L" redirect to folder /subdomain/ (typed like that exactly)

    is that correct?
     
  7. manarak

    manarak Member

    and there is no DNS record of type A required for a subdomain?
     
  8. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    That sould do it, yes.

    Depends on your setup.
    The subdomain must lead to you server's ip address so either you have to create a dns A record or you have a dns A record for *
     
  9. manarak

    manarak Member

    in the normal case of a shared server, there would be no A entry for *, right?

    so there is step number 5, which is to create an A entry in the domain's DNS zone, in the same manner as for www and mail.


    Thank you for your help.
    I think I got it covered now!


    Final procedure for anybody searching in future the same thing on the forum :

    1- create a site standard normally, domain.com
    2- inside that site, create a /subdomain/ subfolder
    3- create a new site on ISPC, with domain subdomain.domain.com
    4- setup an "L" redirect to folder /subdomain/ (typed like that exactly)
    5- create an A-type record associating subdomain to the IP in the DNS Zone of domain, in the same manner as mail or www.
     
  10. manarak

    manarak Member

    ok, I just tried the above setup, and it does *NOT* work...
     
  11. manarak

    manarak Member

    the above procedure is wrong, because it still doesn't work.

    maybe I should create a subdomain instead of a new site.

    1- create a site standard normally, domain.com
    2- inside that site, create a /subdomain/ subfolder inside /www
    3- create a new subdomain on ISPC, with host subdomain.domain.com and domain domain.com and with redirect type "L" to directory /subdomain/
    4- create an A-type record associating subdomain to the IP in the DNS Zone of domain, in the same manner as mail or www


    => the result of this is that the subdomain redirects to the "It works" page which is shown by the server when one types in the IP directly ??

    This is getting frustrating.
     
  12. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Sure you should. Not new site but subdomain!

    Did you put "subdomain" as host or "subdomain.domain.com"?
    You need to put only "subdomain" there, not the domain. The domain is chosen from the select box.


    A site always has it's own web root! A subdomain has the web root of the selected domain.
     
  13. manarak

    manarak Member

    yes, I did all of the above now, but it *still* doesn't work.

    the subdomain now gets redirected to the server root and shows "it works" (default server root for debian lenny)

    I'll rip my hair out over this one!
    !"§$§$$&""%&&/&!
     
    Last edited: Jun 17, 2009
  14. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Could you post the vhost config file?
     
  15. manarak

    manarak Member

    Ok, finally, I got it...

    My shitty windows system kept me from seeing reality.
    Consider this:
    - my network configuration actually cached DNS replies, I then fiddled with the settings until the result on the screen matched with the DNs replies in NSlookup and dig
    - Firefox cache is not refreshed if you reload/refresh the page. This is almost criminal in my eyes. Please hang the guy responsible for this. As a result the size of my cache is now 0.


    Ok, finally the correct procedure was this one:

    1- create a standard site on ISPC3, domain.com, with the standard DNS zone from the template
    2- inside that site, create (for example by FTP) a /subdomain/ subfolder inside /www
    3- create a new subdomain on ISPC, with host 'subdomain' and domain 'domain.com' and with redirect type "L" to directory /subdomain/
    4- create an A-type record associating subdomain to the IP in the DNS Zone of domain, in the same manner as mail or www


    Thank you Croydon for all your help and your patience.
    I didn't expect that Windows XP TCP/IP networking would let me down, and even less did I expect such behavior from FF3.
     
  16. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    You are welcome.

    It is a bit off topic but:
    - you can force reloading of a page in FF by pressing CTRL+SHIFT+R
    - you can flush your windows DNS cache (depends on windows version) by typing "ipconfig /flushdns" in a command window
     
  17. manarak

    manarak Member

    Thanks again for the very useful advice.

    but I am still angry at the Firefox guys.

    there seems to be 2 types of reloads then:

    F5 or ctrl-R reload the page
    and
    shift-ctrl-R reloads the page too, but this time it really reloads it, not for laughs, guaranteed?
     

Share This Page