This is an old revision of the document!


Error 403 Forbidden can be trigger by many things and in this wiki we will show you most of them. Most important think is to check log files when you get the error as there will show from what its.

1. File/Directory permissions

Wrong file or directory permission will show that error. In this case you need to check the perms and put the right ones.

2. Wrong file/directory user

Make sure that the file or directory are using the right user. Lets say that your public_html directory is for username “test” and you put a file index.php as root. That can trigger the error.

3. Deny from htaccess file

If you have code like:

deny from all

or

deny from <your ip address>

4. Indexes

If you have that line in the .htaccess file:

Options -Indexes

Try to remove it or put it on:

Options +Indexes

5. Problem/missing PHP Handler

If the php handler is not setup correctly the Webserver will return error 403.

6. File restriction

In Litespeed webadmin → Configuration → Server → Security there is a option “Restricted Permission Mask”. If you setup to hight value like 644 you will get error 403 for your pages.

7. Mod Security/Waf/fail2ban

Depend what and how mutch requests you are doing for X website the firewall can block you.

8. Throttling

similar to previous case - if you have strict Throttling rules and you make too many connection that can trigger error 403.

9. GeoIP or similar modules

If GeoIP or IP2Loc is allow they can block access to files like wp-login (wp-admin). In this case you need to allow the access.

10. Error 403 in LiteSpeed WebAdmin

There is a option to restrict the access to the WebAdmin. If you forgot to add you IP address ot if its change you can edit it from the conf file in /usr/local/lsws/admin/conf/admin_config.xml

<security>

 <accessControl>
   <allow>XXX.XXX.XXX.XXX</allow>
   <deny>ALL</deny>
 </accessControl>

</security>

Put your IP address in the allow list. For multi IP addresses its look like this:

<allow>XXX.XXX.XXX.XXX, XXX.XXX.XXX.XXX</allow>

  • Admin
  • Last modified: 2018/06/28 10:09
  • by Tihomir