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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Virtual Host Defaulting to 1st one???

Status
Not open for further replies.

grobermatic

Technical User
Dec 21, 2002
153
0
0
GB
Hi,

Here is my virtual host section from my httpd.conf file:

Code:
### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at 
# <URL:[URL unfurl="true"]http://httpd.apache.org/docs-2.0/vhosts/>[/URL]
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.

<VirtualHost *:80>
    #ServerAdmin webmaster@tokentheatre.co.uk
    ServerName tokentheatre.co.uk
    DocumentRoot htdocs/Sites/tokentheatre.co.uk
    #ErrorLog logs/dummy-host.example.com-error_log
    #CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

<VirtualHost *:80>
    #ServerAdmin webmaster@lomasnet.com
    ServerName lomasnet.com
    DocumentRoot htdocs/Sites/lomasnet.com
    #ErrorLog logs/dummy-host.example.com-error_log
    #CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

I'm running Posadis 0.60.6 DNS server. I have both domains setup:

tokentheatre.co.uk.prm (master file)
lomasnet.com.prm (master file)

These both have setup within them.

When I call (I have an index.html file in the root directory for each domain) I always see the file from the tokentheatre.co.uk domain.

From what I can see the 2 virtual hosts are set up correctly as I have simply copied the settings and changed the custom values.

Is there anything else I should be checking? or anyway of debugging the code... stepping through it to see the path it takes?

Any suggestions would be most welcome

Many thanks


Craig

--------------------------------------------------------------------------------------------------------
&quot;Time-traveling is just too dangerous. Better that I devote myself to study the other great mystery of the universe: Women!&quot; .. Dr E. Brown (1985)
 
First, try using "ServerAlias" rather than "ServerName". ServerName has never worked right for me using VirtHosts.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top