gbhall
gbhall

Reputation: 13279

Virtual hosts in Apache acting according to the HTTP Host?

I currently have this set up:

xx.domain.com (CNAME)-> user.dyndns.org -> MY IP

Currently I have virtual hosts setup in Apache so that xx.domain.com points to one directory, and xx.domain.com:8080 points to another.

However what I'm trying to accomplish is rather than differentiating by ports, I want to be able to have xx.domain.com and zz.domain.com point to different directories.

How is this accomplished? ServerAlias and ServerName don't seem to work because I suspect that user.dyndns.org is actually the ServerName. Though my guess may be incorrect.

Thanks.

Upvotes: 0

Views: 469

Answers (1)

mikey
mikey

Reputation: 5160

ServerName should work for you. The HTTP Requests should be coming into your server pointing to the host by the CNAME, not user.dyndns.org -- so you should be OK. Perhaps yours was a port issue when you tested it did you set zz.domain.com to listen on 80 as well?

http://httpd.apache.org/docs/2.0/vhosts/examples.html

Upvotes: 1

Related Questions