How to resolve XAMMP virtual host "Access forbidden!" error in MAC OS Sierra 10.12.6?

1

I just installed a version of XAMPP xampp-osx-5.5.38 -3-installer.dmg .

Then I followed the instructions to set up a virtual host. I enabled Include etc/extra/httpd-vhosts.conf and created 127.0.0.1 md-test.com within /etc/hosts .

So when I write md-test.com I'm redirected to md-test.com/dashboard/ , as expected. I'm redirected to the xampp htdocs directory and loads the dashboard.

In /Applications/XAMPP/htdocs I created a folder called md drwxrwxr-x 3 root admin 102 21 Aug 12:02 md , where I have an index.php file (echo "testok";).

For the httpd-vhosts.conf file this is what I did:

<VirtualHost *:80>
       DocumentRoot "/Applications/XAMPP/htdocs/md/"
       ServerName md-test.com
</VirtualHost>

Now when I run md-test.com/ I'm not redirected to md-test.com/dashboard/ or even using localhost that does not redirect me to localhost/dashboard/ . It only shows an error:

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

md-test.com
Apache/2.4.23 (Unix) OpenSSL/1.0.2j PHP/5.5.38 mod_perl/2.0.8-dev Perl/v5.16.3

I used visual studio to edit the files.

Now even when I delete the changes I made in httpd-vhosts.conf I continue with the error. And this happens for any access in the apache of any url.

I checked the permissions of httpd-vhosts.conf and continue the same as before.

-rw-rw-r--  1 root  admin   1489 22 Aug 11:44 httpd-vhosts.conf

Any idea what this error is?

UPDATE: I found a possible error: When I setup vhosts inside the link Include etc/extra/httpd-vhosts.conf . even when I use full path ( Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf ) I still have the error.

    
asked by anonymous 22.08.2017 / 18:44

1 answer

0

I do not use XAMPP but I suspect it is not specifying AllowOverride

follow example:

<VirtualHost *:80>
    ServerName meusite.local
    DocumentRoot "F:\Projets\Web\site"
    DirectoryIndex index.php
    <Directory "F:\Projets\Web\site">
        Options Indexes FollowSymLinks
        AllowOverride all
        Require all granted
    </Directory>
</VirtualHost>

I suggest that not use:

<Directory />
    Options Indexes FollowSymLinks
    AllowOverride all
    Require all granted
</Directory>

Since it allows all access to the entire drive you installed XAMPP (Apache), if this is the C: \ drive you are making hackers life easier! p>     

22.08.2017 / 19:25