0

I've seen this in the wild before: an Apache server that serves different sites to requests for different domain names, like so:

123.123.123.123
    ^ domainA.com
    ^ domainB.com
    ^ domainC.com

Each one of these domains should have a separate VirtualHost, as well as a global VirtualHost for all other requests (namely those coming directly to the IP address). How can I make this possible on my server?

3
# this is into httpd.conf
NameVirtualHost *

# domain1.com
<VirtualHost *>
ServerName www.domain1.com
DocumentRoot /www/domain1
</VirtualHost>

# domain2.com
<VirtualHost *>
ServerName www.domain2.com
DocumentRoot /www/domain2
</VirtualHost>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.