Server dedicated cPanel / whm 403 forbidden error

Operating System & Version
cpanel / whm
cPanel & WHM Version
v92.0.8

Quintanilha

Member
Feb 25, 2020
16
1
3
Brasil
cPanel Access Level
Root Administrator
Good night, I have a problem in my server, the server has the following error:

Forbidden
You don't have permission to access this resource.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.



The server is online and working but when opening or reloading the sites on the server it presents this error

Print: Screenshot

I have root access to the server but I am unable to resolve

I need urgent help
 
Last edited by a moderator:

Quintanilha

Member
Feb 25, 2020
16
1
3
Brasil
cPanel Access Level
Root Administrator
user permissions are 771

print: Screenshot


Are these permissions right?


I gave permission 777 and did the test when reloading the page of the websites consecutively 10 times it gives error 403 Forbidden
 
Last edited:

cPJustinD

Administrator
Staff member
Jan 12, 2021
183
34
103
Houston
cPanel Access Level
Root Administrator
Hey there! Generally, 403s are indicative of improper permissions set on the directory, or access being forbidden by another server configuration or directive.

You can find our default public_html permissions here:

 

cPJustinD

Administrator
Staff member
Jan 12, 2021
183
34
103
Houston
cPanel Access Level
Root Administrator
You can try enabling the FileProtect for a start.

Code:
If you have enabled the FileProtect option, then each time EasyApache performs an update it is going to make the following changes:

EasyApache will create the /var/cpanel/fileprotect file
The system will execute the script "/usr/local/cpanel/scripts/enablefileprotect"
This sets the user's home directory (/home/$username) to 0711 Permissions.
This sets all document root directories’ (For example, /home/$username/public_html) group to the username user, and 0750 permissions
More on this can be found here:

However, this would only affect the /home/$user and /home/$user/public_html directories. For more recursive changes, you will want to work with your system administrator to formulate a command or script to recursively set the desired permissions across all accounts.
 

Spirogg

Well-Known Member
Feb 21, 2018
136
28
28
chicago
cPanel Access Level
Root Administrator
user permissions are 771

print: Screenshot


Are these permissions right?


I gave permission 777 and did the test when reloading the page of the websites consecutively 10 times it gives error 403 Forbidden

in my cPanel websites in public_html all folders are 755 and all files are 644 depends on your program you are running

what is your index.html or index.php files are they 644

to test this : try to add a directory and file in public_html/test/index.html
the directory test (make it 755) and the file index.html (make it 644) then go to the website address https://yourdomain.com/test/index.html and see if you still get error 403 forbidden if not then your permission is the problem
if it works: then you can select all folders and make them 755 and then select files and make them 644 it might take a little time but I don't have an option for command line to change all folders and file permissions - unless someone else has one

hope this helps.

Spiro