Problems with vHosts

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

Problems with vHosts

Postby mtnracer » 27. January 2009 16:25

I just installed xampp for Windows and I am having problems with virtual hosts. I configured the default site (c:/xampp/htdocs) and another site in httpd-vhosts.conf and when I try to access the site root via a browser the xampp splash screen is displayed.

However, when I try to access any specific page within the site it cannot find the page.

The error I get in error.log is:
[Tue Jan 27 10:01:51 2009] [error] [client 127.0.0.1] script 'C:/xampp/htdocs/test.php' not found or unable to stat

I noticed that it tries to pull test.php from the default htdocs directory - not from c:/vHosts as specified in the conf file.

Any help is much appreciated.
mtnracer
 
Posts: 4
Joined: 27. January 2009 16:16

Re: Problems with vHosts

Postby Wiedmann » 27. January 2009 16:28

Any help is much appreciated.

I guess there is something wrong in your config file ;-) But I don't know what you have in this file...

Are you using namebased or ip-based vhosts?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Problems with vHosts

Postby mtnracer » 27. January 2009 16:35

I am using name based vHosts.

The files I am trying to access are located in c:/vHosts/tsvnet and that is the directory I specified.

When I type "http://tsvnet" in my browser the xampp splash screen comes up. When I type "http://tsvnet/test.php" it fails and the error.log file shows an attempt to access the file from c:/xampp/htdocs.

From what I understand, enabling vHosts is supposed to override the default document root location with the information from httpd-vhosts.conf
mtnracer
 
Posts: 4
Joined: 27. January 2009 16:16

Re: Problems with vHosts

Postby glitzi85 » 27. January 2009 16:36

Pleas post the vHost Configuration here COMPLETE. You flushed your Cache after changing the configuration?

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: Problems with vHosts

Postby mtnracer » 27. January 2009 16:46

I stopped and started the apache service several times now. I have to do it through the Windows Services window as I only get an error when trying to stop or start apache through the Xampp control panel. But that is another issue...


#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

<Directory c:/vHosts>
Order Deny,Allow
Allow from all
</Directory>

#
# 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 all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
## ServerAdmin webmaster@dummy-host.example.com
## DocumentRoot /www/docs/dummy-host.example.com
## ServerName dummy-host.example.com
## ServerAlias www.dummy-host.example.com
## ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
##</VirtualHost>

##<VirtualHost *:80>
## ServerAdmin webmaster@dummy-host2.example.com
## DocumentRoot /www/docs/dummy-host2.example.com
## ServerName dummy-host2.example.com
## ErrorLog @rel_logfiledir@/dummy-host2.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host2.example.com-access_log common
##</VirtualHost>

<VirtualHost *:80>
DocumentRoot c:/xampp/htdocs
ServerName localhost
</VirtualHost>

<VirtualHost *:80>
DocumentRoot c:/vHosts/tsvnet
ServerName tsvnet
</VirtualHost>
mtnracer
 
Posts: 4
Joined: 27. January 2009 16:16

Re: Problems with vHosts

Postby glitzi85 » 27. January 2009 16:55

You must also uncomment NameVirtualHosts, otherwise Namebased vHosts are not enabled:

Code: Select all
NameVirtualHost *:80


glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: Problems with vHosts

Postby mtnracer » 27. January 2009 17:01

That did it. Thank you. Vielen Dank.

BTW: Do you prefer English or German on this Forum? / Bevorzugt ihr deutsch oder englisch auf diesem Forum?
mtnracer
 
Posts: 4
Joined: 27. January 2009 16:16

Re: Problems with vHosts

Postby LooseCannon » 27. January 2009 17:08

Woo! glitz85 got in with a one liner, while I was writing way too much. :)

mtnracer, this is in the English part of the forum. Hello and welcome by the way. 8)
User avatar
LooseCannon
 
Posts: 162
Joined: 18. September 2007 12:07
Location: Hampshire, UK

Re: Problems with vHosts

Postby glitzi85 » 27. January 2009 17:22

8)

viewforum.php?f=32 = German
viewforum.php?f=33 = Both acceptable
viewforum.php?f=34 = English

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 45 guests