Page 1 of 1

virtual host not work

PostPosted: 24. May 2008 16:08
by elallaix
I have set in httpd_vhost.conf

NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot "Q:\xampp\htdocs"
ServerName localhost
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "Q:\xampp\htdocs\test"
ServerName local.test
<Directory "Q:\xampp\htdocs\test">
Options Indexes FollowSymLinks ExecCGI
AllowOverride FileInfo
</Directory>
</VirtualHost>


in the host file of windows I have insert

127.0.0.1 local.test


Localhost functions but local.test does'nt work
I can't understand why
can you help me?

PostPosted: 28. May 2008 10:06
by LooseCannon
Hello and welcome elallaix.

What do you mean by "doesn't work"? How are you accessing the site, ie browser address? What actually happens?

Surely localhost is trully 127.0.0.1? I believe that it's not changed in order to make virtual hosts function. I think one doesn't even need to refer to the default localhost, ie xampp control panel, in the httpd-vhosts.conf file because it's in the main conf file. I don't know and haven't got the time to check at the moment, sorry.

What's the default homepage for the local.test site? You haven't got a DirectoryIndex parameter set. Eg:
Code: Select all
<VirtualHost *:80>
ServerName local.test
DocumentRoot "Q:\xampp\htdocs\test"
DirectoryIndex default.php
<Directory "Q:\xampp\htdocs\test">
Options Indexes FollowSymLinks ExecCGI
AllowOverride All
</Directory>
</VirtualHost>


I've also swapped the sequence of ServerName and Document Root, for my personal, easy-reading preference. Also the AllowOverride is set to All, because I'm don't know of the FileInfo setting and again, haven't got time to look at it atm.

Good luck. Please let us know how you get on.