VirtualHost always redirects to first <virtualhost> entery

Problems with the Windows version of XAMPP, questions, comments, and anything related.

VirtualHost always redirects to first <virtualhost> entery

Postby Jstall » 23. May 2011 19:03

Hello all,

I am trying to set up simple named based virtual hosting on my machine. The problem I am running into is I seem to be getting directed to whatever virtual host I have defined first in my vhosts.conf file. For example here are two entries :
Code: Select all
<VirtualHost localhost:80>
ServerName localhost
DocumentRoot "C:/xampp/xampp/htdocs"
</VirtualHost>


<VirtualHost my.prj:80>
ServerName my.prj
DocumentRoot "C:/xampp/xampp/htdocs/myproject"
</VirtualHost>


Now, in this case if I navigate to http://localhost I end up in the proper place but if I navigate to http://my.prj I will go to C:/xampp/xampp/htdocs. If I switch the order of the hosts putting my.prj first I will get a similar result in that navigating to either addresses will send me to C:/xampp/xampp/htdocs/myproject

Here is the portion of my Windows hosts file I edited for this:
Code: Select all
127.0.0.1       localhost
#   ::1             localhost
127.0.0.1 my.prj



I am still learning about webserver admin so there is much I don't know. I set something like this up similarly on a Linux virtual machine and it seemed to work fine. Could anyone tell me what I am doing wrong here? Any advice is very much appreciated. Thank you very much for your time.
Jstall
 
Posts: 13
Joined: 07. July 2010 20:20

Re: VirtualHost always redirects to first <virtualhost> ente

Postby Jstall » 23. May 2011 21:05

Gah, I foolishly forgot to uncomment the line
Code: Select all
NameVirtualHost *:80

in my httpd-vhosts.conf file. Silly mistake, it works now :D
Jstall
 
Posts: 13
Joined: 07. July 2010 20:20


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 66 guests

cron