Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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:

127.0.0.1       localhost
127.0.0.1       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
NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
   DocumentRoot "X:\Work\Web Development\Projects\disko\serverroot"
   ServerName disko.local
</VirtualHost>

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 127.0.0.1] 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
share|improve this question

1 Answer 1

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

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

Make changes. Restart Apache.

share|improve this answer
    
I'm still getting a 403. The code is now: pastebin.com/z0YTatJQ –  Gabriele Cirulli Oct 22 '11 at 22:45
    
Also, the server is running from a different disk than apache. –  Gabriele Cirulli Oct 22 '11 at 23:05
    
Oh, should I put that inside the VirtualHost tags? –  Gabriele Cirulli Oct 22 '11 at 23:13
    
Nope, still not working. –  Gabriele Cirulli Oct 23 '11 at 11:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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