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.

Hostname / Document Root Problems

Discussion in 'General Discussion' started by CreedFeed, Jan 27, 2004.

  1. CreedFeed

    CreedFeed Member

    Joined:
    Jan 22, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Just got a new Red Hat 3 Enterprise server with Cpanel/WHM set up on it. When I go into WHM and create an account everything works just fine. I create an account for www.domain.com - document root is set to /home/domain/public_html and the hostname is set to domain.com

    When I set up a second account, www.mysite.com, it pulls the hostname and document root from the first domain created. i.e. for the next account I make the document root is set to be /home/domain/public_html and not /home/mysite/public_html - and the host name for that account is set to domain.com and not mysite.com ...

    I noticed this problem at first when the second account I created was using PHP files that utilized the $_SERVER['DOCUMENT_ROOT'] variable. It kept printing the doc root as the previous account's doc root and would create errors because the files the pages required were not being found.

    Any idea what the problem is?
     
  2. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    Submit a bug report to cPanel. Be sure to include login details for your box to epedite a resolution.
     
  3. IvanV

    IvanV Registered

    Joined:
    Jul 30, 2003
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Any updates on this?
    Looks like there is a problem with mod_rewrite.

    Source from apache docs

    Can this be fixed somehow?
     
  4. jeffkee

    jeffkee Registered

    Joined:
    Jan 22, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    My Quick Solution

    I have the same problem. But I found a quick solution to this - may not apply to everybody though depending on server setup.

    Go to "List Accounts"
    And then under the list, go to the one that is giving you the wrong DOCUMENT_ROOT.
    On the IP section (3rd column?), click on the EDIT button.
    Change the default IP to any of the available IP addresses you have on hand to give the site a unique IP.
    Try typing in the unique IP in your browser to a page that has

    Code:
    echo $_SERVER['DOCUMENT_ROOT'];
    Then it seems to show the right DOCUMENT_ROOT. However, I have not tested this after the DNS info has been forwarded so I cannot guarantee what will happen once the domains point properly.
     
Loading...

Share This Page