Fixed: Forbidden Executing in an invalid environment for the supplied user on cPanel

Helposoft Staff

Administrator
Staff member
Points
178
If you encountered an issue on cPanel server where you are getting an "Account Suspended" message and a 403 Forbidden error when trying to access my website, even though the account was newly created or not suspended. I wanted to share my experience and the solution that worked for me in case anyone else faces a similar problem.

Issue: When I accessed my website, I received the following message:

Code:
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
Status: 403 Forbidden Content-Type: text/plain; charset=utf-8 403 Forbidden Executing in an invalid environment for the supplied user

Steps I Took to Resolve the Issue:

  1. Checked Account Suspension Status:
    • Logged into WHM.
    • Navigated to List Accounts to confirm that the account was not suspended.
    • Also checked Manage Account Suspension to ensure the account was not marked as suspended.
  2. Verified File Permissions and Ownership:
    • Ensured that directories had 755 permissions and files had 644 permissions.
    • Verified that the files and directories were owned by the correct user:

      Code:
      chmod 755 /home/username/public_html
      chmod 644 /home/username/public_html/*
      chown -R username:username /home/username/public_html
  3. Reviewed .htaccess Configuration:
    • Renamed the .htaccess file to rule out any restrictive rules:
      Code:
      mv /home/username/public_html/.htaccess /home/username/public_html/.htaccess.backup
  4. Checked Apache and cPanel Configuration:
    • Rebuilt the Apache configuration and restarted the service:

      Code:
      /scripts/rebuildhttpdconf
      service httpd restart

    • Updated user domains in cPanel:

      Code:
      /scripts/updateuserdomains
  5. Examined ModSecurity and Firewall Rules:
    • Reviewed ModSecurity logs and temporarily disabled it for testing.
    • Ensured firewall rules were not blocking legitimate traffic.
  6. Verified DNS Settings:
    • Confirmed DNS settings for the domain were correct.
    • Allowed time for DNS changes to propagate.
  7. SSL Installation (Must):
    • Solution that worked: I installed an SSL certificate for the domain, which resolved the issue immediately. After the SSL installation, the "Account Suspended" message and 403 Forbidden error were no longer displayed.
Conclusion:If you're facing similar issues, I recommend checking your SSL certificate configuration as a potential fix. Installing or reinstalling the SSL certificate can resolve underlying configuration issues that may lead to such errors.

I hope this helps anyone else who might encounter the same problem. If you have any questions or need further assistance, feel free to ask!
 
Top