Results 1 to 6 of 6

Thread: Moving the "Root" Directory on my VPS

  1. #1
    Registered User
    Join Date
    Nov 2011
    Location
    Colorado Springs, Colorado, United States
    Posts
    4
    cPanel/WHM Access Level

    Website Owner

    Default Moving the "Root" Directory on my VPS

    I'm on a VPS with WHM and I've stumbled my to creating an account for a domain. I installed Wordpress Multisite in the root directory; the main blog is the same domain, and I have another dozen domain names pointed to my IP address and "parked" on top of the original domain, with a domain name Wordpress plugin sorting it all out.

    My problem: I want to play around with Magento, and figured that a subdomain would be the best bet. I tried creating a new account for the subdomain, but then realized that I could just set up the subdomain within cPanel for the main domain. So far, so good. What is NOT good is that it set up a folder for my subdomain inside the root folder. Unfortunately, this is where my Wordpress resides, and I really don't want the new folder to sit "inside" Wordpress right along with folders like wp-admin, wp-content, wp-includes.

    SO. The question is, can I move everything currently inside the root directory to a subfolder (say, "wordpress")? I'm not exactly what I'd have to do in order to make sure that visiting the main domain would bring up the wordpress folder.

    I hope that's somewhat clear, and I sincerely appreciate any help you may be able to provide!

  2. #2
    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: Moving the "Root" Directory on my VPS

    I'm not entirely certain I understand when you say root folder. Is the path /home/username/public_html/subfolder for the Magento installation? If so, then I would remove and recreate the subdomain and specify the path to be /home/username/subfolder provided your hosting provider allows non-public_html subdomains. If they do, you should be able to set the directory path during the subdomain creation process by editing the path listed in the cPanel > Subdomains > Document Root field.
    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

  3. #3
    Registered User
    Join Date
    Nov 2011
    Location
    Colorado Springs, Colorado, United States
    Posts
    4
    cPanel/WHM Access Level

    Website Owner

    Default Re: Moving the "Root" Directory on my VPS

    Thanks so much for your help! That WILL actually work.

    I do have another question, as I recreated my subdomain and now my browser can't find it. I have my main domain set up at a registrar and pointed to the IP address of my VPS. Do I also have to set up the subdomain at my registrar, or should setting it up on cpanel be sufficient?

  4. #4
    cPanel Staff cPanelMichael's Avatar
    Join Date
    Apr 2011
    Posts
    14,022
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Moving the "Root" Directory on my VPS

    Hello

    You will need to add in the "A" records for your subdomains at the DNS host of the domain name. Ensure the "A" records for the subdomains point to the IP address of the account.

    Thank you.
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists - Documentation - Migration Services - Change Logs
    -- cPanelMichael - Migration Specialist, Technical Analyst, cPanel Technical Support

  5. #5
    Registered User
    Join Date
    Nov 2011
    Location
    Colorado Springs, Colorado, United States
    Posts
    4
    cPanel/WHM Access Level

    Website Owner

    Default Re: Moving the "Root" Directory on my VPS

    I suspected that. Again, thank you VERY much! Changed the A record, and now we play the waiting game...

    One last question: you gave me a great idea on how to move the subdomain's folder out of the public_html folder, but what if I wanted to change the path to the folder that serves up the main domain?

    In other words, I know where to find the field to change the path to a subdomain's folder, but no idea where to change the path to the main domain's folder.

  6. #6
    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: Moving the "Root" Directory on my VPS

    For the main domain, the only way to change the path would be in /var/cpanel/userdata/username/domain.com file where domain.com is the main domain name. You'll documentroot and homedir paths there for the location where the main domain is served.

    If you edit that file, you will need to run the following commands to update the paths:

    Code:
    cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak111114
    /scripts/rebuildhttpdconf
    /etc/init.d/httpd restart
    I highly suggest making a backup of that file before you edit it:

    Code:
    cd /var/cpanel/userdata/username
    cp domain.com domain.com.bak111114
    Above wherever username is mentioned, this stands for the cPanel account username. Wherever domain.com is mentioned, this represents the main domain on that account.
    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

Similar Threads

  1. Replies: 5
    Last Post: 08-01-2014, 09:31 AM
  2. Replies: 1
    Last Post: 11-07-2013, 07:16 AM
  3. "slave server" / "slave nameserver" for VPS
    By basic in forum Bind / DNS / Nameserver Issues
    Replies: 0
    Last Post: 12-16-2005, 01:55 AM
  4. Replies: 0
    Last Post: 10-12-2005, 07:59 AM
bargain