Crashed website, don't have access to server

August 3, 2018 399 views
Apache WordPress DigitalOcean Ubuntu 16.04

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?

1 comment
  • 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
    
1 Answer
DK400 August 3, 2018
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 {} +

Have another answer? Share your knowledge.