We used this on RaQ3/4/550
Something similar should work on CBQ
Create Sub Domains:
These instructions create a REAL sub domain,
if the virtual site is a front page site, front page will see the
subdomains when the site is edited.
[1] Create a user subdomain in domain.
subdomain is the name for the sub domain in domain virtual site.
[2] Create 'A' records in DNS for domain.com
www.subdomain.domain.com
subdomain.domain.com
For a RaQ2/3/4 follow instructions in [3],[4] and [6]
For a RaQ550 follow instructions in [5] and [6]
[3] Create a file in /etc/httpd/
File name can be anything, I use domain.conf.
Put the following text in the file domain.conf.
<VirtualHost 111.222.333.444>
ServerName www.subdomain.domain.com
ServerAdmin thedomain-admin
ServerAlias subdomain.domain.com
DocumentRoot /home/sites/www.domain.tld/users/subdomain/web
RewriteEngine on
RewriteCond %{HTTP_HOST} !^111.222.333.444(:80)?$
RewriteCond %{HTTP_HOST} !^www.subdomain.domain.com(:80)?$
RewriteRule ^/(.*) http://www.subdomain.domain.com/$1 [L,R]
RewriteOptions inherit
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
</VirtualHost>
NOTE: In the above container replace subdomain, domain-admin, domain,
and 111.222.333.444 with the actual names (values) Add any other
AddHandler types you might need.
[4] edit /etc/httpd/conf/httpd.conf
add a line that states: "include domain.conf" (without quotation marks)
Place this line after the server <VirtualHost> container. This allows
errors to resolve to the server domain instead of one of the sub/domains
Now skip to step 6
[5]RaQ550 Process
You need to add the virtual host container in the sites
/etc/httpd/conf/vhosts/siteNN
Here is an example;
Find the line with "END WebScripting SECTION"
Enter the subdomains one after the other below the folowing line
which contains
#
# Subdomain 1
#
ServerName www.sub.domain.tld
ServerAdmin some-site-admin
ServerAlias sub.domain.tld
DocumentRoot /home/.sites/39/site17/users/sub-domain-name/web/
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
#
# Next Subdomain follows
#
[6] reload httpd
RaQ3 - RaQ4 -RaQ550 /etc/rc.d/init.d/httpd reload