• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 152
  • Last Modified:

virtual host superceding main site problem

Hi there.

I'm running redhat linux, with apache 2.0.50.

I'm trying to create a virtual host with the configuration:

NameVirtualHost xxx.xxx.xxx.xxx:80

<VirtualHost xxx.xxx.xxx.xxx:80>
ServerAdmin webadmin@mydomain.com
ServerName www.mydomain.com
DocumentRoot /var/www/mydomain/
ErrorLog logs/mydomain.com-error_log
</VirtualHost>


To me, this seems fine but when I restart apache, this virtual host becomes the _main_ website, wiping out the previous configuration directive in httpd.conf:
DocumentRoot "/var/www/html"

<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</directory>

etc etc.

any ideas what the heck is going on please?

Thanks

Daryn
0
daryn
Asked:
daryn
1 Solution
 
periwinkleCommented:
Daryn -

If you are using virtual hosts and have multiple entries that match, the first matching site is delivered.  Create a default virtualhost (and list it first) that is your main site.
0
 
ahoffmannCommented:
please post the url you used to connect
0
 
darynAuthor Commented:
sorted. no default virtual domain for the site. silly mistake but i thought there was already a default built into the basic httpd.conf file.

-shrugs helplessly-

ta all
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now