Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Virtual Hosts

Status
Not open for further replies.

manicleek

Technical User
Jun 16, 2004
143
GB
I've tried to set up 2 virtual hosts

Code:
<VirtualHost *> 
ServerName site1
ServerAdmin info@site1.co.uk

DocumentRoot C:\sites\site1\ 
ErrorLog C:\sites\site1\logs\error.log 
CustomLog C:\sites\site1\logs\access.log combined 
</VirtualHost>

<VirtualHost *> 
ServerName site2
ServerAdmin info@site2.co.uk

DocumentRoot C:\sites\site2\ 
ErrorLog C:\sites\site2\logs\error.log 
CustomLog C:\sites\site2\logs\access.log combined 
</VirtualHost>

When I try putting into my browser it just displays site1 how can I change this?
 
This is an easy one!

The problem is that you have no diffenential between the two..

Try putting NameVirtualHost & for the second virtual host, then you will have an identical set up to me so it should work :eek:D

James
 
Member Wullie has written a very helpful FAQ for name-based virtual hosting that should be read by all.

faq65-1831 How to set up Name Based Vitualhosts on Apache
 
manicleek,

You need to use the NameVirtualHost directive, as siberian suggested. In my httpd.conf, it's
NameVirtualHost *:80
and
<VirtualHost *>
ServerName ServerAdmin admin@example.com
DocumentRoot /path/to/doc/root
.
.
.
</VirtualHost>


Wishdiak
A+, Network+, MCSA 2003 certified
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top