Changing public_html to a different folder help

Jan 10, 2013
7
0
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
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.
 
Jan 10, 2013
7
0
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 ?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
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.
 
Jan 10, 2013
7
0
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
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.