Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Update (FOUND A WORKING SOLUTION): http://maff.ailoo.net/2008/07/set-up-multiple-virtual-hosts-on-xampp-for-windows/

 <VirtualHost *:80>
 ServerAdmin webmaster@localhost
 DocumentRoot D:/srv/xampp/projects/testproject/public
 ServerName testproject

 <Directory "D:/srv/xampp/projects/testproject/public">
  Options Indexes FollowSymLinks Includes ExecCGI
  AllowOverride All
  Order allow,deny
  Allow from all
 </Directory>
</VirtualHost>

I had tried re-installing, and no luck. I am using XAMPP 1.7.3, Windows 7 64bit.

Followed instructions from: http://superuser.com/questions/68857/403-forbidden-error-when-trying-to-view-localhost-on-apache/69092#69092

[Sat Oct 16 16:09:54 2010] [notice] Digest: generating secret for digest authentication ...
[Sat Oct 16 16:09:54 2010] [notice] Digest: done
[Sat Oct 16 16:09:54 2010] [notice] Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Sat Oct 16 16:09:54 2010] [notice] Server built: Nov 11 2009 14:29:03
[Sat Oct 16 16:09:54 2010] [notice] Parent: Created child process 4960
[Sat Oct 16 16:09:58 2010] [notice] Digest: generating secret for digest authentication ...
[Sat Oct 16 16:09:58 2010] [notice] Digest: done
[Sat Oct 16 16:09:59 2010] [notice] Child 4960: Child process is running
[Sat Oct 16 16:09:59 2010] [notice] Child 4960: Acquired the start mutex.
[Sat Oct 16 16:09:59 2010] [notice] Child 4960: Starting 150 worker threads.
[Sat Oct 16 16:09:59 2010] [notice] Child 4960: Starting thread to listen on port 443.
[Sat Oct 16 16:09:59 2010] [notice] Child 4960: Starting thread to listen on port 80.
[Sat Oct 16 16:09:59 2010] [notice] Child 4960: Starting thread to listen on port 443.
[Sat Oct 16 16:09:59 2010] [notice] Child 4960: Starting thread to listen on port 80.
[Sat Oct 16 16:10:30 2010] [error] [client 127.0.0.1] client denied by server configuration: C:/projects/test/
[Sat Oct 16 16:10:36 2010] [error] [client 127.0.0.1] client denied by server configuration: C:/projects/test/favicon.ico

vhosts file:

NameVirtualHost *:80
<VirtualHost *:80>
    ##ServerAdmin [email protected]
    DocumentRoot "C:/projects/test"
    ServerName test
    ##ServerAlias www.dummy-host2.localhost
    ##ErrorLog "logs/dummy-host2.localhost-error.log"
    ##CustomLog "logs/dummy-host2.localhost-access.log" combined
</VirtualHost>

hosts:

# Virtual host
127.0.0.1    test
share|improve this question
    
Might want to post your working solution as an answer @Doug –  Sathya Oct 18 '10 at 0:15
    
I will do that. –  Doug Oct 21 '10 at 10:54
add comment

4 Answers

up vote 2 down vote accepted

(FOUND A WORKING SOLUTION): http://maff.ailoo.net/2008/07/set-up-multiple-virtual-hosts-on-xampp-for-windows/

 <VirtualHost *:80>
 ServerAdmin webmaster@localhost
 DocumentRoot D:/srv/xampp/projects/testproject/public
 ServerName testproject

 <Directory "D:/srv/xampp/projects/testproject/public">
  Options Indexes FollowSymLinks Includes ExecCGI
  AllowOverride All
  Order allow,deny
  Allow from all
 </Directory>
</VirtualHost>
share|improve this answer
add comment

This worked for me with Ubuntu 11.10 and version 1.7.7 in httpd.conf i've added the # in the directory to have it work with vhosts. My vhosts were located outside of the root folder...

And change user and group from nobody to your username:

User nobody
Group nobody
</IfModule>
</IfModule>

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
# Options FollowSymLinks
# AllowOverride None
# Order deny,allow
# Deny from all
</Directory>
share|improve this answer
    
Thanks, commenting out the directory stuff solved my problem with 403 errors on development files that weren't in the root. eg /home/sites/mysite vs server root in /opt/lampp/htdocs –  andrew Jan 11 '12 at 21:34
add comment

In the apache folder, go to extra and then open file httpd-xamp.conf.

Edit the following lines:

<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/8 
    ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>

Change the above configuration like below:

<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
    Order deny,allow
    Deny from all
    Allow from all
    ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>

Now restart XAMPP, it will work.

share|improve this answer
    
Didn't work for me :( –  hitautodestruct Jan 7 at 11:26
add comment

Here is an update for newer versions of XAMMP. The syntax has changed a little. Note the line: Require all granted in the Directory block.

<VirtualHost *:80>
  ServerAdmin webmaster@localhost
  DocumentRoot D:/srv/xampp/projects/testproject/public
  ServerName testproject

 <Directory "D:/srv/xampp/projects/testproject/public">
   Options Indexes FollowSymLinks Includes ExecCGI
   AllowOverride All
   Require all granted
 </Directory>
</VirtualHost>
share|improve this answer
add comment

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.