Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Jan 2004
    Posts
    14

    Default Hostname / Document Root Problems

    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. #2
    Member
    Join Date
    Aug 2002
    Posts
    1,052

    Default

    Submit a bug report to cPanel. Be sure to include login details for your box to epedite a resolution.

    The rest of those who have gone before us cannot steady the unrest of those to follow.

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    1

    Default

    Any updates on this?
    Looks like there is a problem with mod_rewrite.

    A virtual host is defined by two pieces of information: its IP address, and the contents of the Host: header in the HTTP request. The dynamic mass virtual hosting technique is based on automatically inserting this information into the pathname of the file that is used to satisfy the request. This is done most easily using mod_vhost_alias, but if you are using a version of Apache up to 1.3.6 then you must use mod_rewrite.
    Source from apache docs

    Can this be fixed somehow?

  4. #4
    Registered User
    Join Date
    Jan 2009
    Posts
    1

    Default 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.

Similar Threads & Tags
Similar threads

  1. Subdomain Document Root
    By Lezarwerks in forum Security
    Replies: 6
    Last Post: 01-30-2010, 07:56 AM
  2. Subdomain Document Root
    By Lezarwerks in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 01-30-2010, 07:56 AM
  3. Change document root
    By mikealim in forum New User Questions
    Replies: 7
    Last Post: 07-01-2009, 03:00 PM
  4. Document Home Root Problem
    By hostaway in forum New User Questions
    Replies: 6
    Last Post: 11-26-2007, 10:10 AM
  5. Document Root?
    By kozmik in forum New User Questions
    Replies: 2
    Last Post: 11-23-2007, 01:28 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube