Add the following to the very bottom of the httpd.conf. If you already have virtualhost directives then you need to replace them..
# # Set up the mass virtual hosting # <VirtualHost *:80> UseCanonicalName off VirtualDocumentRoot /www/%0 VirtualScriptAlias /www/%0/cgi-bin ServerSignature EMail </VirtualHost> # End mass hosting set up
To explain how this works: Apache will replace %0 with the actual full domain that is requested. So, for example, if the visitor requested www.mydomain123.com then apache will look for the DocumentRoot in /www/www.mydomain123.com and the cgi-bin in /www/www.mydomain123.com/cgi-bin
You now need to configure the directories with your files in them to correspond with this set-up. Change all your virtualhost directories to the FULL domain name. So www.me.com would be called from /www/www.me.com and so on..
To set up subdomains, just change the directory name to match.. Eg. subdomain.domain.com would be called from the /www/subdomain.domain.com directory.
If you have scripts with the paths defined, you will also need to alter them to reflect these changes..