Page 1 of 1

XAMPP 1.7.7 virtual host 403 error [Solved]

PostPosted: 22. September 2012 03:09
by MonReveur
I need to be able to access multiple local sites for development. My hosting provider is using Linux but my local laptop is running Windows 7 for development. Here is what I have in httpd-vhosts.conf:

Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin postmaster@localhost
    DocumentRoot "C:/xampp/htdocs"
    ServerName localhost
    ServerAlias www.localhost
    ErrorLog "logs/localhost-error.log"
    CustomLog "logs/localhost-access.log" combined
    <Directory "C:/xampp/htdocs">
        AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin postmaster@carrierscompete
    DocumentRoot "C:/home/carriers/www"
    ServerName carrierscompete
    ServerAlias www.carrierscompete
    ErrorLog "logs/carrierscompete-error.log"
    CustomLog "logs/carrierscompete-access.log" combined
    <Directory "C:/home/carriers/www">
        AllowOverride All
    </Directory>
</VirtualHost>


Here are some of the settings in httpd.conf:

Code: Select all
ServerRoot "C:/xampp/apache"
Listen 80
ServerAdmin postmaster@localhost
ServerName localhost:80
DocumentRoot "C:/xampp/htdocs"


I think I really didn't change much, if anything, in httpd.conf.

However, whenever I put http://carrierscompete in the address bar of any browser, I get the 403 Access forbidden page.

Re: XAMPP 1.7.7 virtual host 403 error

PostPosted: 22. September 2012 17:08
by Altrea
Hi MonReveur,

Have you defined a <Directory> Block for your Path C:/home/carriers/www (like the one for C:/xampp/htdocs you can find in your httpd.conf)?
You need to define permissions for requests, otherwise the default rule will deny all requests.

best wishes,
Altrea

Re: XAMPP 1.7.7 virtual host 403 error

PostPosted: 22. September 2012 19:37
by MonReveur
Altrea wrote:Have you defined a <Directory> Block for your Path C:/home/carriers/www (like the one for C:/xampp/htdocs you can find in your httpd.conf)?
You need to define permissions for requests, otherwise the default rule will deny all requests.


Yes. That's what's so frustrating. I had even tried changing the C:/xampp/htdocs to C:/home/localhost/www and got the same 403 error for localhost. I don't understand. It's getting the 403 error twice. Once on the directory and once on the favicon.

Re: XAMPP 1.7.7 virtual host 403 error

PostPosted: 22. September 2012 20:50
by Altrea
Well, show us your <Directory> Block for that Path. We can't say anything about it without seeing it.
Have you restarted your Apache? Otherwise the configuration changes will not take effect.

Re: XAMPP 1.7.7 virtual host 403 error

PostPosted: 22. September 2012 21:34
by MonReveur
Altrea wrote:Well, show us your <Directory> Block for that Path. We can't say anything about it without seeing it.
Have you restarted your Apache? Otherwise the configuration changes will not take effect.


It's in the httpd-vhosts.conf file listed above... but the directory block there didn't specifically have "order allow,deny" and "allow from all". Fixed that and now it works. I even went chasing after why Windows had the folder marked "Read Only".