Forbidden when accessing my directories - Apache

Asked

Viewed 2,219 times

0

I am using Windows 7 x64 and installed apache 2.4 with PHP 7.1 separately, configured everything and when I place localhost, it works normally.

So inside my htdocs, I created a folder called projects. When I access the address http://localhost/projects/ it returns me 403 Forbidden and does not show me the files I have in it, what I can do to free access ?

NOTE: I do not use WAMP and XAMP, only apache and php native.

UPDATE

My httpd.conf is like this:

DocumentRoot "c:/Apache24/htdocs"

<Directory "c:/Apache24/htdocs">
    Options Indexes FollowSymLinks

    AllowOverride All
    Require all granted
    Options ExecCGI
    Order Deny,Allow
    Allow from all
</Directory>

And I’m using vhosts, httpd-vhosts.conf:

<VirtualHost *:80>
    DocumentRoot "c:/Apache24/htdocs/projetos/vhost.com/"
    ServerName vhost.com
    <Directory  "c:/Apache24/htdocs/projetos/vhost.com">
       Require all granted
    </Directory>
</VirtualHost>


<VirtualHost *:80>
    DocumentRoot "c:/Apache24/htdocs/"
    ServerName localhost
</VirtualHost>

1 answer

1


You need to free access to subfolders through the file httpd.conf located inside the Conf folder in the apache installation directory.

Or add a rule to your file .htacces, good for both cases you can search in this other question down here that has the solution.

How to release a subdirectory protected with . htaccess?

  • How do I do this by httpd.conf ?

  • before that <Directory "..htdocs"> there’s another <Directory />, in it inform only AllowOverride none and Allow from all, if it doesn’t work put your entire httpd.conf file in question.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.