For changing the main/primary domain, you will need to have root SSH access and
be able to locate and edit the following file (replacing your user & domain
info):

/var/cpanel/userdata/USERNAME/DOMAIN.COM

1. Once you have opened the file, look for the following line:

documentroot: /home/USERNAME/public_html

2. Modify the location according to your needs. Save it and exit.

3. Rebuild the Apache conf and restart Apache:

/scripts/rebuildhttpdconf
service httpd restart

The change will be immediate. Simply clear your browser cache and force refresh
the page.

Sub domains in apache——
http://content.websitegear.com/article/subdomain_setup.htm

How to set up suexec to work with virtual hosts and PHP—-
http://www.alain.knaff.lu/howto/PhpSuexec/

SSL–
https://www.digicert.com/ssl-certificate-installation-ubuntu-server-with-apache2.htm