logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Multiple hosts
Author
Irto



Joined: 10 Feb 2013
Posts: 1
Location: Finland

PostPosted: Sun 10 Feb '13 18:44    Post subject: Multiple hosts Reply with quote

Hey,

I bet you've fought with posts like this before but there is something I'm not doing right and I need help.
I have 2 DNS addresses on one PC with one IP.

Exampling:
site1.no-ip.org is located in i:/wamp/www
site2.no-ip.org is located in i:/wamp/www/www2

I have uncommented Include conf/extra/httpd-vhosts.conf in httpd.conf.

My httpd-vhosts.conf looks like this:

<VirtualHost *:80>
DocumentRoot "I:/wamp/www"
ServerPath "I:/wamp/www"
ServerName site1
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "I:/wamp/www/www2"
ServerPath "I:/wamp/www/www2"
ServerName site2
</VirtualHost>

What I'm actually looking for is that http://site1.no-ip.org would use the site in /www, and http://site2.no-ip.org would use the site in /www/www2. I actually had it configured correctly while ago, but I had to reinstall the system and for some reason I never backed up this file, and I really can not how to set it up.

What's wrong? At the moment both http://site1.no-ip.org and http://site2.no-ip.org goes to /www.

Thank you!
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Sun 10 Feb '13 20:28    Post subject: Reply with quote

You need to use the full domain name in ServerName.
The reason why the second domain goes now to the first host is, if there is no domain name machting apache chooses the first vhost to serve the request.
Back to top


Reply to topic   Topic: Multiple hosts View previous topic :: View next topic
Post new topic   Forum Index -> Apache