Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Aug 2001
    Location
    Brisbane, Australia
    Posts
    211

    Question Correct method to change domain account's /home/username path to existing username ?

    Not sure what is the correct method of doing this so any help would be appreciated.

    2 domains
    • domain.com with /home/domcom
    • domain.net with /home/domnet

    now both sites have different set of files in them, but want to change domain.com to using /home/domnet path files. Changing username via modify account won't help as it says domnet already exists.

    Any what's correct method to do this ?

  2. #2
    Member aapkapratik's Avatar
    Join Date
    Oct 2009
    Posts
    24

    Default Re: Correct method to change domain account's /home/username path to existing usernam

    Hello,


    If you just wish to show the data at /home/domnet when accessed http://www.domain.com/ through webbrowser and vice versa , just interchange the DocumentRoot for both domains in
    "/etc/httpd/conf/httpd.conf"
    eg :
    Originally

    <VirtualHost **.**.**.**:80>
    ServerName domain.com
    DocumentRoot /home/domcom

    Change It To

    <VirtualHost **.**.**.**:80>
    ServerName domain.com
    DocumentRoot /home/domnet
    Same should be done for "domain.net" change its DocumentRoot to "/home/domcom".

    Note : Here we have just asked apache server to pick the files from the new location when the URL is requested, so the username and password as well as access rights for both users account will remain the same, as ideally user domcom will not be having access to "/home/domnet"

    If you want to avoid this and do hardship once rather then keep remembering such settings in future.I'll suggest you to please change one of your account's username to any dummy username via
    modify account in WHM

    Suppose if we change the username of account "domain.com" to test.

    Now generate full backup of both the accounts.

    For this Login to the server via SSH with root privileges and use the script

    # /scripts/pkgacct test --force
    &
    # /scripts/pkgacct domnet --force
    This will generate the backup of both accounts in tar.gz formate.

    Now Terminate the account "domain.com" from "Terminate an Account" in WHM.

    Once done first change the username of the account "domain.net" to domcom.

    Now restore the account "domain.com" using the script
    # /scripts/restorepkg test
    Remember we've changed the username of this account to test.

    Now "domain.com" will be having username test, change it to domnet and you are done.
    Pr@T!K R@W@L,
    "Simple, Capable, Ready for the Future"
    http://etechsupport.net, http://esds.co.in
    ESDS Software Solution Pvt.ltd.

  3. #3
    Member
    Join Date
    Aug 2001
    Location
    Brisbane, Australia
    Posts
    211

    Default Re: Correct method to change domain account's /home/username path to existing usernam

    Thanks for that forgot about pkgacct feature. Sites are >30GB in size so could take a while.

    I was also thinking, couldn't you just change the account's primary domain name ?

    so domain.net modify a/c change primary domain name to domain.com ? would need to change domain.com primary domain name to something other than domain.com right ?
    Last edited by eva2000; 12-18-2010 at 09:32 PM.

  4. #4
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Apr 2008
    Location
    PK
    Posts
    443

    Default Re: Correct method to change domain account's /home/username path to existing usernam

    Yes, renaming domnet account's main domain is the better option. Changing VirtualHosts will not last a single upcp and may cause Apache uid/gid mismatch error if not handled properly.
    I would suggest you first rename domain.com to a temporary name like domain_bkp.com and then rename domain.net to domain.com as cPanel does not allow renaming a domain name if it already exists under another account for obvious reasons.

    Quote Originally Posted by eva2000 View Post
    Thanks for that forgot about pkgacct feature. Sites are >30GB in size so could take a while.

    I was also thinking, couldn't you just change the account's primary domain name ?

    so domain.net modify a/c change primary domain name to domain.com ? would need to change domain.com primary domain name to something other than domain.com right ?
    1 solution works for all problems. Trying harder!
    HostMasterTips - Understanding Tech Support

Similar Threads & Tags
Similar threads

  1. Issue creating path when testing using virtual path (~username)
    By ggriffit in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 05-02-2007, 02:29 PM
  2. HTTPd crashes on modify account ( username change )
    By Ferdinant in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 07-14-2006, 09:49 AM
  3. Replies: 2
    Last Post: 02-03-2006, 03:23 PM
  4. username to username+domain with emails?
    By inov in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 12-28-2003, 06:49 AM
  5. EASY SCRIPT: Change main username on an account
    By brandonk in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 03-02-2003, 07:29 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube