Document Root Question

Discussion in 'Linux VPS/Dedicated - cPanel' started by Jan Wojtasinski, Sep 30, 2013.

  1. Jan Wojtasinski

    Jan Wojtasinski New Member

    After migrating my site to KH everything seems to be working fine, with the exception of applications that rely on $_SERVER['DOCUMENT_ROOT']. After tracking down the code it looks like the variable is pointing to the apache/HTDOCS folder instead of the public_html folder in the users home. Any suggestions on how to fix this? I noticed in my httpd.conf that the virtualhost for the site is declared multiple times, once with the actual path and once with the apache/htdocs path. Is it as simple as editing one of the includes files to point that domain to the correct document root?

    Thanks,

    Jan
     
  2. KH-Jonathan

    KH-Jonathan Director of Managed Services Staff Member

    Jan,

    Glad to hear your migration went pretty smoothly! The first thing that comes to my mind regarding this issue is file ownership: who owns the file, the user, nobody, or root?

    If it's root or nobody I bet that's what's causing your issue.
     
  3. Jan Wojtasinski

    Jan Wojtasinski New Member

    Thanks for the reply Jonathan,

    The owner of the file and the folder are both the user. I don't believe it matters but: File permissions are 644 folder permissions are 755.
     
  4. Dan

    Dan Moderator

    Hi Jan,

    Are you accessing your site using the IP/~username? This post on the cPanel forums that says it works fine if you access it using the domain name.
     
  5. Jan Wojtasinski

    Jan Wojtasinski New Member

    Dan, Thank You!!!

    Ill do my best to comb through the forums a little bit more next time. :).

    Jan
     
  6. Dan

    Dan Moderator

    Glad to hear it's working and no problems Jan! :D
     

Share This Page