Setting up a sub-domain via cpanel is extremely easy because there is an option that does everything foer you. Simply go to the domains section of cpanel and select the Subdomains option.
This will open the option that allows you to create and remove subdomains. To create a new suibdomain via this option all that you need to do is to select the domain you want to create a subdomain for from the dropdown list and type the name you want the subdomain to use in front of it. The document Root folder name will then be filled in with a default folder location for the subdomain. If you wish you can change the part of this that follows the / so as to place the subdomain into a folder which does not match to the subdomain name.
If you keep the default document root value then the test.example.com subdomain will correspond to the example.com/test folder. If you don't want the subdomain being able to be accessed as a folder within the domain then simply substitute a random selection of characters into the end of the document root value for example using the testgjdfpo folder to hold the example subdomain and thus making it almost impossible for anyone to guess the name.
Pressing the Create button will create the subdomain which can then be accessed to either set it up to redirect to a different location or to remove it via the entries lower on the page below the create for.
Note that creating a subdomain will create the folder that the subdomain will use (along with some standard files) but will not create any actual pages for the subdomain. Removing a subdomain will remove the subdomain definition but will not touch the folder or its content.
This article written by Stephen Chapman, Felgall Pty Ltd.