Reputation: 173
I have a Laravel project on my CentOS7 server which sits on the folder "/var/www/html/myProject".
I have changed my document root in /etc/httpd/conf/httpd.conf to "/var/www/html/myProject/public" both in "DocumentRoot" and in the directory configure so when i enter the IP in the browser it will automatically show the project.
When i try to do so and access my IP through the browser i am greeted with the messages:
Forbidden You don't have permission to access /form on this server. Server unable to read htaccess file, denying access to be safe
After further examination i have found out that in my /var/log/httpd/error_log i get the following error after every access attempt:
[Thu May 10 19:39:33.683522 2018] [core:crit] [pid 1994] (13)Permission denied: [client 79.182.62.1:51091] AH00529: /var/www/html/myProject/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/html/myProject/' is executable
That was very odd to me since the path is supposed to be /var/www/html/myProject/public, but the "public" is missing.
I have restarted my apache several times, and changed the DocumentRoot path to a fictional path just to check if it updates and it is.
Could it maybe be something in the .htaccess file? although i didn't change the file, i left it as Laravel created it.
Upvotes: 1
Views: 1393
Reputation: 407
Check the permissions on /var/www/html/myProject
files & directories. Based on the error you pasted it seems apache is attempting to read in data from your myProject
directory as directed by the .htaccess file. This is normal operation.
Figure out what user/group your apache is running is. Then remember that your files have to be readable that user and all parent directories have to be accessible (hint: execute bit) for that user.
Finally check the bootstrap/cache and storage laravel directories (& subdirectories) are writeable by the apache user.
Upvotes: 0