403 Forbidden You don't have permission to access /folder-name/ on this server

前端 未结 5 1273
再見小時候
再見小時候 2020-12-23 15:09

I was looking for an answer to my problem, but I could\'nt find any answer which solves my case.

The problem is that I can\'t access the app folders in my var/www/ f

相关标签:
5条回答
  • 2020-12-23 15:26

    **403 Forbidden **

    You don't have permission to access /Folder-Name/ on this server**

    The solution for this problem is:

    1.go to etc/apache2/apache2.conf

    2.find the below code and change AllowOverride all to AllowOverride none

     <Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride all      Change this to--->  AllowOverride none
        Require all granted
     </Directory>
    

    It will work fine on your Ubuntu server

    0 讨论(0)
  • 2020-12-23 15:35

    Solved the problem with:

    sudo chown -R $USER:$USER /var/www/folder-name
    
    sudo chmod -R 755 /var/www
    

    Grant permissions

    0 讨论(0)
  • 2020-12-23 15:40

    if permission issue and you have ssh access in root folder

    find . -type d -exec chmod 755 {} \;
    find . -type f -exec chmod 644 {} \;
    

    will resolve your error

    0 讨论(0)
  • 2020-12-23 15:43

    Solved issue using below steps :

    1) edit file "/etc/apache2/sites-enabled/000-default.conf"

        DocumentRoot "dir_name"
    
        ServerName <server_IP>
    
        <Directory "dir_name">
           Options Indexes FollowSymLinks
           AllowOverride None
           Require all granted
        </Directory>
    
        <Directory "dir_name">
           AllowOverride None
           # Allow open access:
           Require all granted
    

    2) change folder permission sudo chmod -R 777 "dir_name"

    0 讨论(0)
  • 2020-12-23 15:50

    under etc/apache2/apache2.conf, you can find one or more blocks that describe the server directories and permissions

    As an example, this is the default configuration

    <Directory /var/www/>
       Options Indexes FollowSymLinks
       AllowOverride None
       Require all granted
    </Directory>
    

    you can replicate this but change the directory path /var/www/ with the new directory.

    Finally, you need to restart the apache server, you can do that from a terminal with the command: sudo service apache2 restart

    0 讨论(0)
提交回复
热议问题