Apache Serving Incorrect Files With Sub-server

I just set up a sub-server, speedtest.example.com. In /home/${USER}/domains/speedtest.example.com/public_html, I downloaded and unzipped a speedtest web application. I then added a CNAME record to my domain's DNS records (I host my DNS on a different service for redundancy) pointing speedtest.example.com to example.com. I then loaded speedtest.example.com in my web browser, and Apache served up the files in /home/${USER}/public_html. I changed the CNAME record to an A record, pointing speedtest.example.com to my server's IP address, however the situation remains the same. What could be the issue here? speedtest.example.com is pointing at the correct IP, and CNAME records I added enitially, such as admin.example.com and webmail.example.com work fine.

[Update 04:37PM (GMT - 06 February 2011): example.com, the top-level server, was set to catch requests for all subdomains (i.e. ServerAlias *.example.com in /etc/apache2/sites-enabled/example.com.conf). Looks like enabling this setting causes Apache to ignore requests for actual subdomains that are created as sub-servers in Virtualmin. Not sure if adding each sub-server to the top-level server's .conf file as a ServerAlias would fix this problem. I haven't submitted this as a bug as it's unclear to me whether this is an issue with Virtualmin, Apache, or both.

Status: 
Closed (fixed)

Comments

Yes, that could cause it .. the *.example.com rule may match before the speedtest.example.com .

Unfortunately the only way to avoid this is to re-order the Apache config files so that speedtest is processed first. On Ubuntu this is tricky as they are each in a separate file, which are processed in alphabetical order..