I'm just messing around with virtual hosts on my XAMPP + Apache install on Windows to make it work so that http://disko.local redirects to a folder in my PC where the project's files are stored. I've added the following lines to C:\Windows\System32\drivers\etc\hosts:       localhost       disko.local
::1             localhost

And then proceeded to edit the file X:\xampp\apache\conf\httpd.conf to add these lines at the bottom of the file (do they have to be in any special place?):

# My custom vhosts

   DocumentRoot "X:\Work\Web Development\Projects\disko\serverroot"
   ServerName disko.local

With a fast search through the file I determined that that was the only vhost present in the file.

Then I restarted Apache, opened my browser and tried to load the page http://disko.local/artists.html. This is the error that appeared:

Access forbidden!

You don't have permission to access the requested object. It is either read-protected or not readable by the server.

If you think this is a server error, please contact the webmaster.

Error 403

disko.local 10/22/11 16:06:58 Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1

I tried adding a .htaccess file containing the string allow from all but that was of no help.

Here's what the error.log file says:

[Sat Oct 22 16:06:58 2011] [error] [client] client denied by server configuration: X:/Work/Web Development/Projects/disko/serverroot/artists.html

What am I doing wrong? Do I have to add anything to the VHost definition? Thanks in advance.

P.S.: Here's the version of Apache, in case it's needed:

X:\xampp\apache\bin>httpd.exe -v
Server version: Apache/2.2.21 (Win32)
Server built:   Sep 10 2011 11:34:11

Your missing the directory permissions. Inside the virtualhost block place...

<Directory "X:\Work\Web Development\Projects\disko\serverroot">
  order allow,deny
  allow from all

Make changes. Restart Apache.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.