2
votes

Checked almost stackoverflow answers but getting same error, using windows server 2012 installed XAMPP( Apache/2.4.33 (Win32) OpenSSL/1.0.2o PHP/5.6.36 ).

xampp does not access any project from htdocs other than xampp dashboard.

Error :

enter image description here

httpd-vhost.conf :

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/mysite"
    ServerName local.yourdomain.com
    <Directory "C:/xampp/htdocs/mysite">
        Require all granted 
    </Directory>
</VirtualHost>

hosts :

127.0.0.1       localhost
127.0.0.1       local.yourdomain.com

httpd.conf :

DocumentRoot "C:/xampp/htdocs/mysite"
<Directory "C:/xampp/htdocs/mysite">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks Includes ExecCGI

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Require all granted

</Directory>
1
mysite folder is empty?Metalik
Have you checked your directory permissions to ensure that apache has (at least) read access to the htdocs directory? If Apache is installed as a service (i.e. it will start with windows), then it will run as the System user.Michael Thompson
@Metalik - not checked, but default it goes to xampp dashboard. its in htdocs only, so htdocs are accessible right?151291
Please let me know how to check the apache read access for htdocs.151291
try to change document root on virtual host valuebound.com/resources/blog/…Metalik

1 Answers

0
votes

I have found that these 403 errors are (almost) always Apache configuration errors. Unfortunately there is not a lot of diagnostics in the logs for this.

Try this in your httpd-vhosts.conf file:

    <VirtualHost *:80>
      ServerName example.local
      DocumentRoot "C:\Users\shipl\htdocs\example"
      <Directory "C:\Users\shipl\htdocs\example">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
      </Directory>
    </VirtualHost>

Your hosts then would have:

127.0.0.1       localhost
127.0.0.1       example.local

Note that 'example.local' and '\htdocs\example' must be consistent in all the references.

Hope this helps.