Apache 403 Forbidden Error

25,343

You have to allow Apache to access the root folder of your LAMP files: See https://stackoverflow.com/questions/9110179/adding-virtualhost-fails-access-forbidden-error-403-xampp-windows-7

Edit the conf file in /etc/apache2/sites-available/yourconffile.conf

Enter following:

<VirtualHost localhost:80>  
 DocumentRoot "/path/to/your/rootfolder"  
        <Directory "/path/to/your/rootfolder">  
            # AllowOverride All      # Deprecated  
        # Order Allow,Deny       # Deprecated  
        # Allow from all         # Deprecated  
        # --New way of doing it  
        Require all granted    
    </Directory>  
</VirtualHost>
Share:
25,343

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    I have apache 2.4.23 installed on my elementary os freya(Ubuntu 14.04). i installed it as a LAMP stack... I keep getting the 403 permission denied error any time i tried to run http://localhost on my browser. I have my apache2.conf configured like this:

    <Directory /media/windisk/xampp/htdocs>
      Options Indexes FollowSymLinks
      AllowOverride None
      Require all granted
    </Directory>
    

    i find on some sites that i should run this code to change the permission okf the folder:

    sudo chown bosunski:www-data /media/windisk/xampp/htdocs
    sudo chmod -R 755 /media/windisk/xampp/htdocs
    chmod -R g+rwX /media/windisk/xampp/htdocs/
    

    I ran all this commands but the error is still there. please is there anything i've been missing? OR How can i correct this?