Virtual hosts giving me fits
Posted: 20. May 2011 04:27
I keep all of my web files on a separate partition from my C drive, and would like to be able to access them from there (outside of my htdocs directory) with xampp.
After googling around a bit, it seems the best solution is virtual hosts (and that gives me the added bonus of having them set up as root directories for relative linking). However, setting up those virtual hosts is giving me fits and giving me 403 Access Denied errors.
For this example, let's just say my website is stored in P:/awesomesauce. Here's what I've done.
Added the following lines to httpd-vhosts.conf:
Added the following to my hosts file...
However, when I then go to awesomesauce.localhost in my browser I get the following...
Googling has led me to lots of discussions about it, but no solution that I could get working.
Help!
After googling around a bit, it seems the best solution is virtual hosts (and that gives me the added bonus of having them set up as root directories for relative linking). However, setting up those virtual hosts is giving me fits and giving me 403 Access Denied errors.
For this example, let's just say my website is stored in P:/awesomesauce. Here's what I've done.
Added the following lines to httpd-vhosts.conf:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
<Directory "C:/xampp/htdocs">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "P:\awesomesauce"
ServerName awesomesauce.localhost
<Directory "P:\awesomesauce">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Added the following to my hosts file...
# xampp virtual hosts
127.0.0.1 localhost awesomesauce.localhost
However, when I then go to awesomesauce.localhost in my browser I get the following...
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
awesomesauce.localhost
5/19/2011 11:26:23 PM
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
Googling has led me to lots of discussions about it, but no solution that I could get working.
Help!