Results 1 to 8 of 8

Thread: Change directory of Main Domain

  1. #1
    Member
    Join Date
    Jul 2012
    Posts
    5
    cPanel/WHM Access Level

    Root Administrator

    Default Change directory of Main Domain

    Hi, I just started learning how to use C-Panel. I created a new account. Although my main domain which is mydomain.com points to home/username which isn't a live(public_html) folder? I then created an FTP account that goes to mydomain.com. How do I direct the main domain mydomain.com to the ftp folder. That way I can view a live website with that domain name?

  2. #2
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    10,053
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Change directory of Main Domain

    I've removed your live links, there is no need to give your actual domain name when asking a question here.

    When you create an account, your public_html directory is the same as mydomain.com. It's located here:
    /home/username/public_html/

    You already have an FTP account available as the account owner. You'd log in to it using mydomain.com for the hostname. You'll use the cpanel username as the login name and the cPanel username's password.

    No addon FTP account is required.

  3. #3
    Registered User
    Join Date
    Aug 2012
    Posts
    3
    cPanel/WHM Access Level

    Reseller Owner

    Default Re: Change directory of Main Domain

    I have access to cPanel and WHM on our dedicated server.
    In cPanel one particular domain is treated as a primary domain and others as addon domains. That primary domain's web root is "/public_html". We can add more domains and can choose any directory as their root. But don't seem to be able to change primary domain's web root.

    I want to change the primary domain's web root. How do I do that? My server support guy said I'd have to do it through SSH (Linux command line).

    Please tell me there is a way to do this without knowing Linux.

    Also, for all of those with the "why," I want all domains to have their own folder inside the public_html folder as apposed to inside the first (main) website's folder. I don't want to see any other site folders when I'm editing the main site via FTP and risk deleting sites just from a mis-click or something. I've done it before When you look at code and stuff for a long time, things can start to blend. You know? Also, coders an be (probably should be) anal too, so they want things to be a certain way.

    THANK you for your time!

    Chris
    Last edited by gmedia01; 08-24-2012 at 09:23 PM.

  4. #4
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    7,611
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Change directory of Main Domain

    Hello Chris,

    There is not a way to change it without knowing SSH. This is set in /var/cpanel/userdata/username/maindomain.com file. If you want to change the documentroot there, you'd revise the /home/username/public_html line and then run the following commands to update Apache's configuration:

    Code:
    cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak120824
    /scripts/rebuildhttpdconf
    /etc/init.d/httpd restart
    You might consider posting a feature request for the main domain to be configurable for a different path during account creation. That would be at Feature Requests for cPanel & WHM for new feature requests.

    Thanks!
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  5. #5
    Member
    Join Date
    Jul 2011
    Location
    Palmerston North, New Zealand
    Posts
    41
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Change directory of Main Domain

    gmedia01, I am curious as to why you want all domains to have their own folders inside /home/<username>/public_html/ instead of /home/<username>/
    The latter seems to be a better alternative as you don't have to deal with another tier in the directory tree.
    Also note that addon domains don't have to be placed in public_html, they can be placed inside any folder in /home/<username>/
    Regards
    Stefan Andres Charsley
    WebFront.co.nz

  6. #6
    Registered User
    Join Date
    Aug 2012
    Posts
    3
    cPanel/WHM Access Level

    Reseller Owner

    Default Re: Change directory of Main Domain

    Quote Originally Posted by charsleysa View Post
    gmedia01, I am curious as to why you want all domains to have their own folders inside /home/<username>/public_html/ instead of /home/<username>/
    The latter seems to be a better alternative as you don't have to deal with another tier in the directory tree.
    Also note that addon domains don't have to be placed in public_html, they can be placed inside any folder in /home/<username>/
    Did you read the other half of my original post? Does that answer your question?

    Thanks!

    Chris

    - - - Updated - - -

    Quote Originally Posted by cPanelTristan View Post
    Hello Chris,

    There is not a way to change it without knowing SSH. This is set in /var/cpanel/userdata/username/maindomain.com file. If you want to change the documentroot there, you'd revise the /home/username/public_html line and then run the following commands to update Apache's configuration:

    Code:
    cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak120824
    /scripts/rebuildhttpdconf
    /etc/init.d/httpd restart
    You might consider posting a feature request for the main domain to be configurable for a different path during account creation. That would be at Feature Requests for cPanel & WHM for new feature requests.

    Thanks!
    I am concerned that you are right. I saw a post back in 2009 that asked the same thing and someone replied that it would be "fixed" or added in the next release. Three years later....

    Well, I definitely don't know SSH. I don't even know where to access it. I'll snoop around WHM...

    Thanks for the help!

    Chris

  7. #7
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    7,611
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Change directory of Main Domain

    If you cannot learn SSH, then you might want to hire someone, because you will need someone to manage the server who knows SSH at some point. You cannot do everything with a control panel frontend.

    Here's a catalog of system administrators and developers:

    Sys Admin Services | cPanel App Catalog
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  8. #8
    Member
    Join Date
    Jul 2011
    Location
    Palmerston North, New Zealand
    Posts
    41
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Change directory of Main Domain

    Quote Originally Posted by gmedia01 View Post
    Did you read the other half of my original post? Does that answer your question?

    Thanks!

    Chris

    - - - Updated - - -



    I am concerned that you are right. I saw a post back in 2009 that asked the same thing and someone replied that it would be "fixed" or added in the next release. Three years later....

    Well, I definitely don't know SSH. I don't even know where to access it. I'll snoop around WHM...

    Thanks for the help!

    Chris
    Sorry it only partially answers my question because with your way you are just creating more hassle for yourself when a solution for what you want to do is already available without have to do anything in SSH, all you have to do is put the folders inside /home/<username>/ instead of /home/<username >/public_html/ and leave the main domain inside public_html
    Regards
    Stefan Andres Charsley
    WebFront.co.nz

Similar Threads

  1. Addon domain looking for files at Main directory
    By xso in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 04-12-2012, 07:00 PM
  2. HELP: How to change the main domain
    By heasousa in forum New User Questions
    Replies: 1
    Last Post: 10-05-2010, 01:13 AM
  3. How can I change main domain?
    By aritoni in forum New User Questions
    Replies: 13
    Last Post: 10-14-2007, 08:02 PM
  4. Replies: 2
    Last Post: 05-23-2006, 04:27 AM
  5. Change parked domain to main domain
    By SonServers in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 01-04-2005, 05:42 PM