Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Changing public_html to a different folder help

Discussion in 'General Discussion' started by StarWebHosting, Aug 23, 2013.

  1. StarWebHosting

    Joined:
    Jan 10, 2013
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    I have installed Anahita (/http://anahitapolis.com/menu/get-started) on an account without to much issue but when the script has been installed it says :

    Hint: you need to custom configure your server to recognize the /http://localhost/myproject/www as the home directory of your website.

    I have made changes to /etc/httpd/conf/httpd.conf to change public_html to myproject/www but after restarting httpd nothing seems to happen.

    I have also tried running : /usr/local/cpanel/bin/apache_conf_distiller --update

    but again nothing seems to happen.

    Does anybody have any ideas how to change the public_html folder to myproject/www?

    The folder /myproject is setup in the /home/username/myproject
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,961
    Likes Received:
    1,821
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    You can modify the document root for a domain name by editing the "documentroot" entry in the appropriate cPanel user data file:

    Code:
    /var/cpanel/userdata/$username/$domain.com
    Then, rebuild the Apache configuration file via:

    Code:
    /scripts/rebuildhttpdconf
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. StarWebHosting

    Joined:
    Jan 10, 2013
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Hi,

    Thank you for your reply.

    I have resetup the site from scratch and made the changes that you recommended but this didn't seem to change anything.

    I am trying to change /home/$username/public_html to /home/$username/myproject/www So when people navigate to the site they go to the /www folder and not public_html.


    Is this change possible or does it need to be in the public_html directory for it to work like : /home/$username/public_html/myproject/www ?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,961
    Likes Received:
    1,821
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Could you let us know what was not changed? For instance, did the content not load, or was there a specific error message? Typically, yes, using a directory within public_html is recommended because it's already configured by default.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. StarWebHosting

    Joined:
    Jan 10, 2013
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Hi,

    When you navigate to the site you see a blank page with Index of /$username and underneath Parent Directory and cgi-bin/

    Then when i made the changes i expected to be taken to the site (located in the www folder) but i was still taken to the same blank page Index /$username etc.

    I will try to setup the site in the public_html folder. When i do this will a redirection to /home/$username/public_html/myproject/www/ be more straightforward - so when you navigate to the domain you open up the www folder instead of the public_html folder?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,961
    Likes Received:
    1,821
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    You could configure the documentroot value to:

    /home/$username/public_html/myproject/www

    It's possible you need to clear your browser cache to see the updated content.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice