Error 403 "Access denied" — we eliminate the reasons


This error occurs when the server could not execute the request due to forbidden access to the file. This occurs most often in three cases:



  • There is no index file in the directory (index.html for example) and it is forbidden to view the list of files in this directory* or on the entire virtual server. You can try to create a file with the name index.html and see if the error disappears.

  • There are such "rights" of access to the file that the Apache web server could not read the file on the server disk. Try changing the access rights to 644, for example.

  • The user tried to access the script (in the cgi-bin directory), which has incorrect permissions — there is no right to read + execute (r+x) a specific script. Change the permissions to 755.


*By default, viewing the list of files in the directory is prohibited. In order to allow the output of a list of files, you need to create a file.htaccess, in which to write the Options +Indexes directive as a separate line.