403 Forbidden

Hi guys, I am trying to install elgg on a virtual machine and I am stuck on the second part of the installation which is from a web browser. I am getting a 403 Forbidden Error with the next message: 

"You don't have permission to access /elgg/ on this server."

The elgg folder is under /var/www/html/elgg --> I have tried changing permissions of the folder to 644, 755 and even 777 (which I understand is risky) but I still can't find the solution to it. 

Can anyone help please?

Thank You in advance.

  • Hello,

    I modified the httpd.conf file and left like this:

    DocumentRoot "/var/www/html/elgg"

    <Directory "var/www/html/elgg">

    AllowOverride All

     

    </Directory>

    Now I write on the browser localhost:8080/elgg and it shows the error code is httpd 500.

    ---------------------------------------------------------------------------------------------------------

    I tried to copy the php file outside the folder /elgg, so now I have a file in /var/www/html --> install.php and that also doesn´t work:

    Error I am getting --> Couldn't include '/var/www/html/vendor/autoload.php'. Did you run `composer install`?

    Can I please get some help on this?

    Thank you 

     

     

  • It shouldn't be necessary to change the permissions of the files and folders of the content of the Elgg zip file after extracting its content. The permissions should already be correct (and setting unnecessary write permissions is definitely a bad idea).

    I would suggest to leave DocumentRoot in httpd.conf unchanged. But setting AllowOverride All for the install folder of Elgg is definitely necessary. Another second config step you probably must do is manually creating the file .htaccess in the Elgg install folder (copy the file /var/www/html/elgg/vendor/elgg/elgg/install/config/htaccess_dist from the extracted zip file to /var/www/html/elgg/.htaccess). Within this file set the RewriteBase to /elgg/, i.e. the line

    RewriteBase /elgg/

    would have to be added (there's some explanation what to do included in the file already).

    Also, you must have the mod_rewrite Apache module installed and enabled on your server.

  • Hello,

    Thank you so much for your reply. The issue was solved with the most stupid mistake, I had to install elgg inside the /var/www/html folder and I was doing the installation in home. Thankfully I realised. But thanks anyways.