The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

confused about how subdomains work

Discussion in 'General Discussion' started by baidarkabob, Apr 16, 2003.

  1. baidarkabob

    baidarkabob Well-Known Member

    Joined:
    Jan 12, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Alaska
    Hello,

    I am using WHM/Cpanel to manage a server that has about ten sites on it. None of the sites currently have any subdomains.

    I notice that if i type a subdomain to ANY site on our server I am directed to the same site each time.

    Example:

    Sites on server - abc.com, def.com, ghi.com, jkl.com, etc.

    No subdomains have been established.

    Just for a test I type in the URL box of my browser: mail.ghi.com - I am directed to abc.com. Test again with mail.jkl.com - I am redirected to abc.com.

    Why is this happening? and what is the best way to get folks who mistype subdomain info properly directed so they at least land somewhat near the site they were aiming for?

    Bob
     
  2. xsenses

    xsenses Well-Known Member

    Joined:
    Aug 29, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Huntington Beach, Ca
    Their is an entry for mail just like there is an entry for ftp and www. Try making something up like test.domain.com, it won't resolve.
     
  3. baidarkabob

    baidarkabob Well-Known Member

    Joined:
    Jan 12, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Alaska
    yes but...

    You are right. But why does mail.jkl.com go to abc.com? And now that you mention it, ftp.jkl.com goes to abc.com too?

    Thanks for your help.

    bob
     
  4. xsenses

    xsenses Well-Known Member

    Joined:
    Aug 29, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Huntington Beach, Ca
    Ah - I read your post wrong. Why don't you post the contents of the DNS zones in question?
     
  5. baidarkabob

    baidarkabob Well-Known Member

    Joined:
    Jan 12, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Alaska
    #5 baidarkabob, Apr 16, 2003
    Last edited: Apr 16, 2003
  6. xsenses

    xsenses Well-Known Member

    Joined:
    Aug 29, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Huntington Beach, Ca
    Wow that is strange add mail and it takes you to the hobbit hole. Does that happen to all your domains? Beyond my knowledge, I would enter a support ticket or maybe someone else a bit more knowledable can help.
     
  7. baidarkabob

    baidarkabob Well-Known Member

    Joined:
    Jan 12, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Alaska
    yep, all domains...

    I thought that was pretty strange. I will submit a support ticket as you suggest and will be otherwise standing by for help from the forums.

    Thanks again.

    bob
     
  8. Website Rob

    Website Rob Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    1,506
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Alberta, Canada
    cPanel Access Level:
    Root Administrator
    I'm starting to get a better understanding as to why, DarkOrb appears to be somewhat 'lax' in answering questions and/or troubleshooting problems. Not enough people are going back to the source and/or figuring things out for themselves. If a person only knows how to operate WHM/Cpanel or some other type Control Panel, they should not be running a Server where people's livelihood or income, depend on it running properly and smoothly. Not sure if that is the situation here.

    Bob, it only took a few minutes to determine there is nothing wrong with WHM/Cpanel and in fact, you should be discussing this problem with your Server provider. I have to wonder, if you've first spoken to them about this problem? Seems not enough people go to their provider before seeking outside help.

    All the same page and IP: 66.129.86.150
    http://mail.flying-squirrel.org/
    http://mail.discoverysoutheast.org/

    http://camulod.flying-squirrel.org/
    http://ns1.camulod.flying-squirrel.org/
    http://6612986150.focalhosting.com/


    Apache Test Page and IP: 66.129.86.151
    http://ns2.camulod.flying-squirrel.org/
    http://6612986151.focalhosting.com/


    Anyone with a bit of ServerAdmin experience will know pretty quick, exactly what the problem is -- and it is with the Server provider and your current Server setup -- i.e. Nameservers and IP delegation.

    Forgive me if this answer seems harsh and to the point, too late in the evening I guess. :)
     
  9. xsenses

    xsenses Well-Known Member

    Joined:
    Aug 29, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Huntington Beach, Ca
    Rob -
    while I think the majority of your post is correct DarkOrb rarely directly answers or addresses the majority of the questions placed in the forum, as I am sure the function was to enable other users to help each other out with the usual stuff easing the burden on the "true" support issues.

    Everyone starts somewhere on the learning curve and making people scared to post in the forum just drives the traffic to other sites.

    Now off to bed for me too.....
     
  10. baidarkabob

    baidarkabob Well-Known Member

    Joined:
    Jan 12, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Alaska
    early on the learning curve

    Rob, no problem on the harshness of your message. I would not dare take this stuff personal. The server is for a non-profit to offer web services to its members (mostly space for file sharing), including a few web-sites. Nobody is trying to maintain a livelihood through the web here.

    I am the server admin. I set up the nameservers and IPs.

    I am not sure what to be asking my service provider and I am not understanding what is wrong with the nameservers and delegation. I would love to learn more if you are inclined to elaborate.

    Thanks,

    bob

    PS - Dave got back to my service ticket very promptly. He said if all the sites are set up as virtual hosts that what is occuring is normal. Now i need to research what a virtual host is, and make sure that is indeed the case here, and if so, ask myself if that is how i want these sites set up, and if not, find out how to change.
     
    #10 baidarkabob, Apr 17, 2003
    Last edited: Apr 17, 2003
  11. baidarkabob

    baidarkabob Well-Known Member

    Joined:
    Jan 12, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Alaska
    thanks jaunra

    I was just reading that. Google search for virtual host took me right there.

    Maybe i was confused by some advice the service provider gave me. . . I have 8 IP addresses that came as part of the deal on a dedicated server. I have dns1 and dns2 assigned to the first two IP addresses and I have all sites assigned to the first IP in my list, same as dns1. Is this bad management? I was told it did not matter how i spread the sites over the IP's unless the site had a specific reason to have its own IP.

    I will keep reading the docs but would appreciate the continued support.

    thanks,

    bob
     
  12. baidarkabob

    baidarkabob Well-Known Member

    Joined:
    Jan 12, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Alaska
    ouch...

    My tail is tucked. I have gone through the above materials a couple times and I am still pretty unclear.

    If I assign a site its own IP is it no longer a virtual host?

    This terminology confuses me. I am a biologist. None of the sites on this server are hosting anything but there own site.

    Bob
     
  13. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    The issue you're having comes from having several domains sharing the same IP. I'll try to simplify this as much as possible.

    Open your Apache config file (/usr/local/apache/conf/httpd.conf) and look for the <VirtualHost> blocks. You will find several <VirtualHost 66.129.86.150:80> blocks. For example:

    <VirtualHost 66.129.86.150:80>
    ServerName www.domain1.com
    ServerAlias domain1.com
    DocumentRoot /home/user1/public_html
    </VirtualHost>

    <VirtualHost 66.129.86.150:80>
    ServerName www.domain2.com
    ServerAlias domain2.com
    DocumentRoot /home/user2/public_html
    </VirtualHost>

    When Apache starts, it reads this config and from the ServerName and ServerAlias directives it knows that:

    www.domain1.com points to /home/user1/public_html
    domain1.com points to /home/user1/public_html
    www.domain2.com points to /home/user2/public_html
    domain2.com points to /home/user2/public_html

    Now when you open www.domain2.com with your browser, what your browser really does is to request a page from the web server installed at 66.129.86.150 (because www.domain2.com resolves to that IP). But since there can be several domains hosted at that IP, it must also say from which domain it is requesting the page - www.domain2.com in this case.

    When Apache receives the request, it looks in the list above and points you to /home/user2/public_html.

    Now what happens if you open ftp.domain2.com? Well ftp.domain2.com resolves to 66.129.86.150 too, but there's no entry for ftp.domain2.com in the list above. What Apache will do is simply choosing the first virtual host in the config file and so points you to /home/user1/public_html.

    Obviously you don't want that to happen, so you have two options:

    - Either add ftp.domain2.com to the ServerAlias directive of the second VirtualHost block,

    - Or create a "catch-all" <VirtualHost 66.129.86.150:80> block which you will place before all other virtual host blocks. In fact it's likely that this block already exists but is misplaced.

    Of course the second alternative is easier to maintain because it's automatic.

    Example:
    http://www.spanishcool.com/
    but:
    http://mail.spanishcool.com/
     
  14. baidarkabob

    baidarkabob Well-Known Member

    Joined:
    Jan 12, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Alaska
    many thanks...

    Thank you Jaunra. I am coming along. I know how to add ftp. and mail. etc via cpanel. I am only managing a handful of sites and have no intention of expanding on this so maybe creating the subdomains is the best solution. I say that because I lost you in understanding how to create a catchall for each block. I would like to do this if it would be useful/efficient for my circumstances.

    Thanks again.

    Bob
     
Loading...

Share This Page