Skip to main content

Change Main Domain Home Directory

Comments

3 comments

  • server9host
    Hello, For sub-domain it's done automatically means when you created dev.mydomain.com then it's point to /home/cyber/dev document root. For the main domain you need to contact to your hosting provider. Thanks
    0
  • cPanelMichael
    Hello :) It's not possible to change the default document root for the primary domain name associated with the account if you do not have root access to your system. You will have to consult with your hosting provider to have them make that change for you. Thank you.
    0
  • wstar
    I did have access to the system. After many hours of searching, I have found the solution. I thought it would be nice to share. These are the steps I followed. I hope they help someone else out there. Indeed you must have root access to the server using SSH. Step 1: Login using SSH as a root user. In my case, I had to create a normal user and enter su -
    Step 2: I went to the follow directory. USER being the primary user for the account. /var/cpanel/userdata/USER/
    You then open the domain file. If you need help finding the file, just use ls
    to list the files. Special note: If your site is SSL, you must edit both the normal domain and the SSL version. I opened the file using vi DOMAIN
    Once open, look for the directories. There should be two. Once changed, save the file and exit the editor. Remember to change the SSL version of the domain also if you have it. Step 3: Run the following commands and it will instantly work. /scripts/rebuildhttpdconf service httpd graceful
    Once last note. If you are then trying to create sub-domains, you must give access for the user to create them on the parent folder. This option for me was in the Server Tweaks.
    0

Please sign in to leave a comment.