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.

Problems with new subdomains.

Discussion in 'General Discussion' started by ClearSky, Mar 24, 2006.

  1. ClearSky

    ClearSky Well-Known Member

    Joined:
    Jul 9, 2003
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Hey all,

    Recently newly created subdomains are not working (on multiple domains as well). If I create a subdomain test.mydomain.com it just sends them to www.mydomain.com.

    I've messed around with various redirections, deleted it, recreated it, waited a week, restarted apache and bind, looked in /var/cpanel/users/, at httpd.conf, a the zone files for the domains.

    Nothing is standing out. Yet all newly created subdomains just redirect straight to the main domain.

    Any ideas?
     
  2. Murtaza_t

    Murtaza_t Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    476
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Earth
    cPanel Access Level:
    Website Owner
    Could be a problem with the .htaccess of your main domain, How does the .htaccess look?
     
  3. ClearSky

    ClearSky Well-Known Member

    Joined:
    Jul 9, 2003
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    I'll look at that this morning, but remember this is across multiple domain names.
     
  4. Giannis

    Giannis Well-Known Member

    Joined:
    Jun 22, 2005
    Messages:
    54
    Likes Received:
    0
    Trophy Points:
    6
    i have the same problem with subdomains and there is nothing on htaccess.

    all dns records are ok i can access subdomain with www.site/subdomain bt not subdomain.site.com

    when i test subdomain.site.com from nwtolls.com it apears ok with all records ok.

    what might cause this problem please?

    thank you.
     
  5. ClearSky

    ClearSky Well-Known Member

    Joined:
    Jul 9, 2003
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Unfortunatly I cannot find anything in my .htaccess files that would cause this problem either. So I'm still stumped.

    Anyone else have an idea?
     
  6. koolcards

    koolcards Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    146
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Tampa, Fl
    verify the "A" record (or CNAME) is actually being broadcast using "DNS lookup" at http://www.dnsstuff.com/ . It may be broadcasting something completely different than what you expect.
     
  7. ClearSky

    ClearSky Well-Known Member

    Joined:
    Jul 9, 2003
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    For me everything looks fine, the working subdomains look the same as the ones that do not.
     
  8. koolcards

    koolcards Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    146
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Tampa, Fl
    Can you give us the actual names? domain and subdomain so we can be more specific in checking? Also, paste the virtualhost container for the subdomain that isn't working please so we can look at the syntax.
     
  9. ClearSky

    ClearSky Well-Known Member

    Joined:
    Jul 9, 2003
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Sure, here's one of the domains that isn't working:

    Domain: gamesentry.com
    Working subdomain: uo.gamesentry.com
    Broken subdomain: wow.gamesentry.com

    I did just notice that a test one I created when I first found this problem is all of a sudden working, blarg.gamesentry.com, so now I'm a bit more confused and will have to dig deaper, because I can't see anything wrong (though it's probably obvious, hehe)
     
  10. koolcards

    koolcards Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    146
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Tampa, Fl
    Both have valid "A" rec's and http://uo.gamesentry.com/ works fine so rule out the DNS. http://wow.gamesentry.com/ does not so it's a matter of apache having a problem (or a directory not existing and a 404 error trap sending browsers back to the 'root'). Was apache restarted after adding the new subdomain so it 'saw' the new configuration and is the syntax for that site correct?
     
  11. koolcards

    koolcards Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    146
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Tampa, Fl
    http://www.dnsstuff.com/tools/http.ch?name=wow.gamesentry.com
    shows:

    "HTTP/1.1 302 Found"
    This web server is using HTTP version 1.1. It is responding with '302 Found' (meaning that the page has moved temporarily -- see the 'Location:' header for the temporary location). Browsers should still use wow.gamesentry.com.

    "location: http://www.gamesentry.com"
    The correct location for the 'index' page is http://www.gamesentry.com. The web browser should redirect there.
     
  12. ClearSky

    ClearSky Well-Known Member

    Joined:
    Jul 9, 2003
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Hi (and thanks for the help),

    Yes, apache was restarted, actually a couple of times since it was added, the directory does exist (and permissions and ownership checked). I found one small problem with the virtualhost entry for wow.gamesentry.com, the domlogs entry differed slightly from others, I've corrected this, but I don't see how this would be the issue.
     
  13. koolcards

    koolcards Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    146
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Tampa, Fl
    uuum, try pasting the virtualhost container for wow.gamesentry.com here and let other people take a look. It seems to me, unless there's an .htaccess or html redirect, the apache container for the site is where the problem is located.
     
  14. ClearSky

    ClearSky Well-Known Member

    Joined:
    Jul 9, 2003
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Here it is, redirects were the first thing I checked and there are no .htaccess files with anything in them.

    Code:
    <VirtualHost 216.12.200.52>
    ServerAlias www.wow.gamesentry.com
    ServerAdmin wwwadmin@gamesentry.com
    DocumentRoot /home/gamesent/public_html/wow
    BytesLog domlogs/wow.gamesentry.com-bytes_log
    ServerName wow.gamesentry.com
    
    <IfModule mod_php4.c>
      php_admin_value open_basedir "/home/gamesent:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    <IfModule mod_php5.c>
      php_admin_value open_basedir "/home/gamesent:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    
    User gamesent
    Group gamesent
    CustomLog /usr/local/apache/domlogs/wow.gamesentry.com combined
    ScriptAlias /cgi-bin/ /home/gamesent/public_html/wow/cgi-bin/
    </VirtualHost>
    
     
  15. koolcards

    koolcards Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    146
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Tampa, Fl
  16. ClearSky

    ClearSky Well-Known Member

    Joined:
    Jul 9, 2003
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Ahh PEBKAC. Redirection via a php file on that one. I have no clue how/why it got there, goes to show that you should start at the bottom and not the top of a problem. Man...

    I assume I did this a while ago, and only looked into this domain when I had troubles on another www.guildaccount.com, where the same problem occures with a subdomain blah.guildaccount.com, yet I just trippled checked (how embarassing) there is no files to redirect at all, and just to be sure guildaccount.com/blah works just fine.

    I can't express how stupid I feel. Anyhow, this is the container for this subdomain,

    Code:
    <VirtualHost 216.12.201.50>
    ServerAlias www.blah.guildaccount.com
    ServerAdmin webmaster@blah.guildaccount.com
    DocumentRoot /home/guildacc/public_html/blah
    BytesLog domlogs/blah.guildaccount.com-bytes_log
    ServerName blah.guildaccount.com
    
    <IfModule mod_php4.c>
      php_admin_value open_basedir "/home/guildacc:/usr/lib/php:/usr/local/lib/php:$
    </IfModule>
    <IfModule mod_php5.c>
      php_admin_value open_basedir "/home/guildacc:/usr/lib/php:/usr/local/lib/php:$
    </IfModule>
    
    User guildacc
    Group guildacc
    CustomLog /usr/local/apache/domlogs/blah.guildaccount.com combined
    ScriptAlias /cgi-bin/ /home/guildacc/public_html/blah/cgi-bin/
    </VirtualHost>
    
    I have checked redirects in cpanel along with subdomain redirects, nothing exists. Nor are there any .htaccess files.

    Thank you for the help, and the prompting, sure helps to have someone to bounce things around with at times.
     
  17. koolcards

    koolcards Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    146
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Tampa, Fl
    yes, but the situation is pretty much the same. DNS is fine and the apache directives look okay so it has to be another redirect, this one I'd suspect a .htaccess file in a higher directory. But, easy to test.

    My suggestion is to remove that subdomain in apache and make sure both httpd and named reload to catch the changes. Then add the subdomain back (might even remove the entire domain, if you can, just to start from scratch again). When it's rebuilt, use anything as an index.html to tell the difference (index.html to make sure there's not something funky about the 'index' directive).

    Starting from the begining with a blank slate should tell what the problem's been.
     
  18. ClearSky

    ClearSky Well-Known Member

    Joined:
    Jul 9, 2003
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Good point, thank you for the help, I really appreciate it.
     
Loading...

Share This Page