I have the following virtual host config:
<VirtualHost *>
ServerName books.domain.com
ServerAlias ebooks.domain.com
DocumentRoot /home/media/books/
<Directory /home/media/books>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /home/domain.com/logs/error.log
CustomLog /home/domain.com/logs/access.log combine
ServerSignature Off
</VirtualHost>
<VirtualHost *>
ServerName domain.com
ServerAlias domain.info domain.net domain.org *.domain.com *.domain.info *.domain.net *.domain.org
DocumentRoot /home/domain.com/public_html/
<Directory /home/domain.com/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /home/domain.com/logs/error.log
CustomLog /home/domain.com/logs/access.log combine
ServerSignature Off
</VirtualHost>
domain.com is the same across both virtual host directives
The problem is that books.domain.com is being served from the /home/domain.com/public_html/
directory
Host:
header? What happens if you include port numbers in the vhost definitions, like<VirtualHost *:80>
?