Question

Crashed website, don't have access to server

I was looking to add permissions on my server so i can edit files and somehow ended up crashing the whole site. Now im getting the following error:

Forbidden
You don't have permission to access / on this server.
Server unable to read htaccess file, denying access to be safe

Apache/2.4.18 (Ubuntu) Server at nutritionsupply.co Port 443

I looked at the logs and was able to retrieve the following errors:

[Fri Aug 03 01:44:47.545537 2018] [core:crit] [pid 32690] (13)Permission denied: [client 99.228.252.65:10967] AH00529: /var/www/html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/html/' is executable, referer: https://nutritionsupply.co/
[Fri Aug 03 01:44:52.538084 2018] [core:crit] [pid 32690] (13)Permission denied: [client 99.228.252.65:10967] AH00529: /var/www/html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/html/' is executable
[Fri Aug 03 01:44:52.698072 2018] [core:crit] [pid 32690] (13)Permission denied: [client 99.228.252.65:10967] AH00529: /var/www/html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/html/' is executable, referer: https://nutritionsupply.co/
[Fri Aug 03 01:45:36.234395 2018] [core:crit] [pid 32073] (13)Permission denied: [client 99.228.252.65:10993] AH00529: /var/www/html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/html/' is executable, referer: https://nutritionsupply.co/wp-admin/admin.php?page=aws-options
[Fri Aug 03 01:45:50.225236 2018] [core:crit] [pid 32502] (13)Permission denied: [client 99.228.252.65:10994] AH00529: /var/www/html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/html/' is executable, referer: https://nutritionsupply.co/wp-admin/theme-editor.php?file=functions.php&theme=Divi
[Fri Aug 03 01:45:54.188500 2018] [core:crit] [pid 32502] (13)Permission denied: [client 99.228.252.65:10994] AH00529: /var/www/html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/html/' is executable, referer: https://nutritionsupply.co/wp-admin/post.php?post=455&action=edit
[Fri Aug 03 01:47:36.246086 2018] [core:crit] [pid 31888] (13)Permission denied: [client 99.228.252.65:11016] AH00529: /var/www/html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/html/' is executable, referer: https://nutritionsupply.co/wp-admin/admin.php?page=aws-options
[Fri Aug 03 01:49:36.229880 2018] [core:crit] [pid 410] (13)Permission denied: [client 99.228.252.65:11033] AH00529: /var/www/html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/html/' is executable, referer: https://nutritionsupply.co/wp-admin/admin.php?page=aws-options
[Fri Aug 03 01:51:36.236811 2018] [core:crit] [pid 31868] (13)Permission denied: [client 99.228.252.65:11082] AH00529: /var/www/html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/html/' is executable, referer: https://nutritionsupply.co/wp-admin/admin.php?page=aws-options
[Fri Aug 03 01:53:37.234074 2018] [core:crit] [pid 32503] (13)Permission denied: [client 99.228.252.65:11125] AH00529: /var/www/html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/html/' is executable, referer: https://nutritionsupply.co/wp-admin/admin.php?page=aws-options

Any ideas on what i screwed up?

Subscribe
Share

Heres a list of commands i ran before i ran into the error

sudo chown -R dima:dima /var/www
sudo chown www-data:www-data /var/www
sudo usermod -aG www-data dima
sudo chmod -R 774 /var/www

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Figured it out, accidentally applied 774 permissions to the entire group and subgroup.

Fix was chown www-data back to the /var/www folder and then run the command below to apply all the correct permissions across the file system. Make sure you cd into /var/www before running below.

find html -type f -exec chmod 664 {} + -o -type d -exec chmod 775 {} +