403 error Forbidden You don't have permission to access / on this server.

November 16, 2015 4.4k views
Control Panels DNS WordPress DigitalOcean

http://prntscr.com/93a23y
It has emerged this mistake when updating the permalinks, and do not know how to fix it

2 comments
2 Answers

The first step would be checking your webserver's logs for errors. If you are running Apache, run the following command to read the last few lines of the error log:

sudo tail /var/log/apache2/error.log

Otherwise, if you're running Nginx, use this command instead:

sudo tail /var/log/nginx/error.log
  • [Mon Nov 16 09:34:03.686237 2015] [access_compat:error] [pid 2175] [client 2a03:2880:20:aff0:face:b00c:0:1:17727] AH01797: client denied by server configuration: /var/www/html/wp-content/plugins/cookie-law-info/images/overlay.png, referer: http://deporte-es-salud.com/wp-content/plugins/cookie-law-info/css/cli-style.css?ver=1.5.3
    [Mon Nov 16 09:34:03.702558 2015] [access_compat:error] [pid 2172] [client 2a03:2880:20:aff0:face:b00c:0:1:42533] AH01797: client denied by server configuration: /var/www/html/wp-content/plugins/wp-content-copy-protector/images/warning.png, referer: http://deporte-es-salud.com/ejercicios-para-hacer-en-casa/
    [Mon Nov 16 09:34:11.466861 2015] [access_compat:error] [pid 2165] [client 2a03:2880:20:aff0:face:b00c:0:1:10870] AH01797: client denied by server configuration: /var/www/html/wp-content/uploads/2015/06/cropped-eldeporteessaludicog-557f1120v1_site_icon1-192x192.png, referer: http://deporte-es-salud.com/ejercicios-para-hacer-en-casa/
    [Mon Nov 16 09:34:11.664032 2015] [access_compat:error] [pid 2165] [client 2a03:2880:20:aff0:face:b00c:0:1:10870] AH01797: client denied by server configuration: /var/www/html/wp-content/uploads/2015/06/cropped-eldeporteessaludicog-557f1120v1_site_icon1-32x32.png, referer: http://deporte-es-salud.com/ejercicios-para-hacer-en-casa/
    [Mon Nov 16 09:35:13.243593 2015] [access_compat:error] [pid 2163] [client 186.3.165.9:50315] AH01797: client denied by server configuration: /var/www/html/
    [Mon Nov 16 09:36:32.300617 2015] [access_compat:error] [pid 2167] [client 181.25.27.116:55647] AH01797: client denied by server configuration: /var/www/html/ejercicios-para-hacer-en-casa, referer: https://www.google.com/
    [Mon Nov 16 09:36:33.440560 2015] [access_compat:error] [pid 2740] [client 107.167.109.104:38920] AH01797: client denied by server configuration: /var/www/html/feed
    [Mon Nov 16 09:36:33.757788 2015] [access_compat:error] [pid 2167] [client 181.25.27.116:55647] AH01797: client denied by server configuration: /var/www/html/favicon.ico, referer: http://deporte-es-salud.com/ejercicios-para-hacer-en-casa/
    [Mon Nov 16 09:36:38.019056 2015] [access_compat:error] [pid 2167] [client 181.25.27.116:55647] AH01797: client denied by server configuration: /var/www/html/ejercicios-para-hacer-en-casa, referer: https://www.google.com/
    [Mon Nov 16 09:36:38.382093 2015] [access_compat:error] [pid 2167] [client 181.25.27.116:55647] AH01797: client denied by server configuration: /var/www/html/favicon.ico, referer: http://deporte-es-salud.com/ejercicios-para-hacer-en-casa/
    
    
  • http://prntscr.com/93efh3

    This major errors are reflected from yesterday
    AH01797: client denied by server configuration: /var/www/html/
    AH01797: client denied by server configuration: /var/www/html/feed
    AH01797: client denied by server configuration: /var/www/html/favicon.ico,

@bbriones90

As a reference (for the future):

https://wiki.apache.org/httpd/ClientDeniedByServerConfiguration

Specifically, from the above, you may need to check your Order, Deny directives and correct or add them (if they do not already exist).

Beyond that, you should also check to make sure that the user & group that Apache is run as has the permissions to read, write and execute from your defined directories, and that all files and directories have proper CHMOD values (typically 0644 for PHP files and 0755 for directories - ideally, nothing should have a 0777, or world-writable CHMOD).

--

If this issue is a result of updating (WordPress?) permalinks, you can safely delete the .htaccess file in the web root (make a backup first by downloading to your PC/Mac). When you click on save or update in /wp-admin under the permalinks menu, a fresh .htaccess file will be generated for you.

You should also scan other directories for any stray .htaccess files to ensure that one is not clashing with another.

If generating a new one does not fix the issue, this would be the time to begin disabling all plugins. Why? Plugins have the ability to write to your .htacccess file by default. If there's a plugin that is making changes and making a mess of the file, only by disabling all plugins and proceeding to enable them one-by-one again will you be able to find the issue (if related to a plugin and if the error logs are not providing you with more details).

Feel free to also post your .htaccess file here and I'll be more than happy to take a look at it for you.

Have another answer? Share your knowledge.