Skip to content

Instantly share code, notes, and snippets.

@AndreiTelteu
Created September 17, 2018 15:59
Show Gist options
  • Save AndreiTelteu/717ed2039913965e5451513e128fb67d to your computer and use it in GitHub Desktop.
Save AndreiTelteu/717ed2039913965e5451513e128fb67d to your computer and use it in GitHub Desktop.
cPanel/WHM change documentroot
  1. Edit this files:
/var/cpanel/userdata/username/domain.tld
/var/cpanel/userdata/username/domain.tld_SSL

Change documentroot and scriptalias for cgi-bin

  1. (optional) Remove cache files:
rm /var/cpanel/userdata/username/domain.tld.cache
rm /var/cpanel/userdata/username/domain.tld_SSL.cache
  1. Run commands to apply changes:
/scripts/updateuserdatacache #purge cache
/scripts/rebuildhttpdconf    #change conf
/scripts/restartsrv_httpd    #restart apache service

Source: https://forums.cpanel.net/threads/changing-document-root-for-primary-domain-does-not-work.626703/#post-2547087

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment