Link to home
Start Free TrialLog in
Avatar of morten444
morten444

asked on

WAMP Server: only working with first virtual host and 1 sub domain

Hi
I am in the process of moving 50 websites from IIS to WAMP
I am using Apache 2.0.58
I have created several virtual host in the httpd.com file and also in the host file

This is how it looks from the top:
-----------------------------------------------------------------------------------------------------------------
# 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@dummy-host.example.com
#     DocumentRoot /www/eadvice_demo
#     ServerName eadvice.dk
#     ErrorLog logs/eadvice.dk-error_log
#     CustomLog logs/eadvice.dk-access_log common
#</VirtualHost>



<VirtualHost *:80>
    ServerAdmin morten@e-advice.dk
    DocumentRoot "C:\wamp\www\eadvice_demo"
    ServerName eadvice.dk
    ErrorLog "logs/eadvice-error.log"
    CustomLog "logs/eadvice-access.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin NK25@tvind.dk
    DocumentRoot "C:\wamp\www\videos"
    ServerName pictures.nytaarskoncert-tvind.dk
    ErrorLog "logs/pictures-error.log"
    CustomLog "logs/pictures-access.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin morten@e-advice.dk
    DocumentRoot "C:\wamp\www\magleby"
    ServerName magleby.dk
    ErrorLog "logs/magleby-error.log"
    CustomLog "logs/magleby-access.log" common
</VirtualHost>

--------------------------------------------------------------------------------------------------------------------
Like this the www.eadvice.dk and the http://pictures.nytaarskoncert-tvind.dk WORKS OK

but www.magleby.dk shows the website for www.eadvice.dk

If i move www.magleby to the top of the virtual server list it will show magleby.dk even when i type www.eadvice.dk

Its like it will only display the first virtual host and virtual sub domain.

I hope someone can spot the error.  I am sure its basic but I am just stuck

Regards
Morten
ASKER CERTIFIED SOLUTION
Avatar of lennartvdd
lennartvdd
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
magleby.dk is not the same as www.magleby.dk, you need to define that as well.

Example:

<VirtualHost *:80>
    ServerAdmin morten@e-advice.dk
    DocumentRoot "C:\wamp\www\magleby"
    ServerName magleby.dk
    ServerAlias www.magleby.dk
    ErrorLog "logs/magleby-error.log"
    CustomLog "logs/magleby-access.log" common
</VirtualHost>
Woops screwed that up with extra virtualhost tags, and got sniped anyway haha :D
Avatar of morten444
morten444

ASKER

Hi
Thanks. That resolved the problem

Thanks
sorry rjdown ;)