subdomain/virtualhost problem on unix + apache

Posted by Aaron on Server Fault See other posts from Server Fault or by Aaron
Published on 2010-08-31T00:08:52Z Indexed on 2010/12/31 1:55 UTC
Read the original article Hit count: 411

Hello,

I'm having a strangely difficult time setting up a subdomain (x.example.com). The main site works fine, but I get 404 errors attempting to hit x.example.com no matter how I set up the VirtualHost config.

NameVirtualHost *:80
<VirtualHost *:80>
 ServerName www.example.com
 DocumentRoot /var/www/example.com/htdocs
 ServerAlias example.com
</VirtualHost>

<VirtualHost *:80>
    ServerName x.example.com
    ErrorLog /var/logs/x-error-log
    CustomLog /var/logs/x-access-log common
    DocumentRoot /var/www/x/htdocs
</VirtualHost>

As far as I can tell, this is a vanilla set up. Any suggestions would be appreciated.

© Server Fault or respective owner

Related posts about apache

Related posts about virtualhosts