shadow2007
asked on
forwarding cname to vhost
I have vhost setup one tld and a sub domain (since they are in different directories).
ex.
<VirtualHost *:80>
ServerAdmin webmaster@domain.com
DocumentRoot /var/www/html
ServerName www.domain.com
ErrorLog /var/log/httpd/www.domain.com-error_log
CustomLog /var/log/httpd/www.domain.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@domain.com
DocumentRoot /var/www/sub/html
ServerName sub.domain.com
ErrorLog /var/log/httpd/sub.domain. com-error_ log
CustomLog /var/log/httpd/sub.domain. com-access _log common
</VirtualHost>
when i use a cname "test.differentdomain.com" to pint to sub.domain.com, the request takes me domain.com ????? can someone help me ?
ex.
<VirtualHost *:80>
ServerAdmin webmaster@domain.com
DocumentRoot /var/www/html
ServerName www.domain.com
ErrorLog /var/log/httpd/www.domain.com-error_log
CustomLog /var/log/httpd/www.domain.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@domain.com
DocumentRoot /var/www/sub/html
ServerName sub.domain.com
ErrorLog /var/log/httpd/sub.domain.
CustomLog /var/log/httpd/sub.domain.
</VirtualHost>
when i use a cname "test.differentdomain.com"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
yep i figured that after I posted this :) thanks anyway for the spot on answer :)
NameVirtualHost *:80
This is a required statement that enables name-based virtualhosting.
Please refer to Apache's documentation:
http://httpd.apache.org/docs/2.0/mod/core.html#namevirtualhost