[Apache] Host 2 Websites?

Soldato
Joined
6 Jan 2005
Posts
3,633
Location
Cambridge
Hi, I've had a look around the internet and I'm still not entirely sure how do this.

I've got an apache server, I can make it so when I direct a domain to the IP it will open the website which it's hosting, but now I want to host 2 websites on the server, how can I do this?

So I want, for example,
domain1.com to go to /var/www/domain1.com/index.php
and domain2.com to go to /var/www/domain2.com/index.php

How can I make it so Apache realises which domain is being used and sends the data according to that?
The server is running CentOS if that changes anything.

Any help will be greatly appreciated.

Thanks,
yhack
 
Excellent, that worked perfectly, thanks!

Is there any way to make www.domain1.com and domain1.com go to the same place without putting that code twice with both domains?
 
Back
Top Bottom