Virtual Hosts not working

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

Virtual Hosts not working

Postby Nightshade » 23. October 2008 15:37

I have XAMPP 1.6.5

I have an external drive which I use to store website files. I try to set this up as a virtual host in httpd-vhosts.conf with these lines:

Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot "Y:\Work"
    ServerName shareddrive
</VirtualHost>


However with these lines in my vhosts file I get the following error when starting Apache: "Apache HTTP Server has encountered a problem and needs to close. We are sorry for the inconvenience."

If I remove these lines from the vhosts file I don't get the error when starting Apache.

Why can't I set up my external drive as a virtual host?!
Nightshade
 
Posts: 5
Joined: 23. October 2008 15:34

Postby Wiedmann » 23. October 2008 15:55

This external drive is connected?

(BTW: use forward slashs)
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Nightshade » 23. October 2008 17:25

Yes the external drive is connected and is accessible through My Computer with the Y: drive letter.

I tried using forward slashes but still get the crash/error
Nightshade
 
Posts: 5
Joined: 23. October 2008 15:34

Postby Wiedmann » 23. October 2008 17:30

when starting Apache

How did you start Apache?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Nightshade » 23. October 2008 17:58

Apache isn't running from startup so I goto XAMPP Control Panel and click Start on Apache. When I have a blank httpd-vhosts.conf it runs within a few seconds and has a green "running" text next to Apache. With my external drive set up in the vhosts file I get the error message.
Nightshade
 
Posts: 5
Joined: 23. October 2008 15:34

Postby Wiedmann » 23. October 2008 18:53

I goto XAMPP Control Panel and click Start on Apache.

Is "Svc" checked or not?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Sharley » 24. October 2008 02:20

You may also have to set access permissions for the folder Work as the defaults in the httpd.conf file are restrictive and only allow access to the htdocs tree unless overridden in your vhost container.

Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
ServerName shareddrive
DocumentRoot "Y:/Work"
<Directory "Y:/Work">
Options Indexes +FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
The error message in the .\xampp\apache\error.log would possibly be 403 Access Denied if permissions are not set for a given folder outside of the htdocs tree.
Last edited by Sharley on 24. October 2008 10:08, edited 1 time in total.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Postby Nightshade » 24. October 2008 09:52

Thinking that the external drive was causing the problems I moved the files to another Windows XP computer on my network. I mapped the network drive to X:/ in Windows, however XAMPP still won't work with it. (I will be using X:/ now and not Y:/Work though).

I tried uninstalling XAMPP and installing a fresh install of XAMPP 1.6.8 to see if that would help, no luck same problem. All I did to modify the 'stock' installation was add this to httpd-vhosts.conf:

Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
   ServerName shareddrive
   DocumentRoot "X:/"
</VirtualHost>


I also tried this (but no luck either):

Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
   ServerName shareddrive
   DocumentRoot "X:/"

   <Directory>
      Options Indexes +FollowSymLinks Includes ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
   </Directory>

</VirtualHost>


Sharley I think you missed a '>' at the end of the Directory tag?

I checked Apache's error log but no mention of a 403 error in there.

One more thing. I have "127.0.0.1 shareddrive" in my hosts file. Is this right? Should this be the IP address of the network drive instead?
Nightshade
 
Posts: 5
Joined: 23. October 2008 15:34

Postby Nightshade » 24. October 2008 09:58

Oh and I also tried the above with:

Code: Select all
<Directory "X:/">
Nightshade
 
Posts: 5
Joined: 23. October 2008 15:34


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 49 guests