Error Magento 2.3.4 - If you are still facing this problem you should consider to find a better host

Cyberpanel Versión: 2.0.1

Hello, Community, I have a client working under magento in my cyberpanel and it reports the following error with magento already installed.

Your web server is set up incorrectly and allows unauthorized access to sensitive files. Please contact your hosting provider.

We follow the order of things … we googled, saw a solution and applied without obtaining a positive result.

We finally received this recommendation:

Recommendations
If you are still facing this problem, you should consider to find a better hosting here. All list of Magento 2 hosting providers for you to get started.

Any idea why this is happening and how could I fix it?

In CyberPanel or any panel, OpenLiteSpeed won’t work with Magento due to hole punching not being offered. You need to move your client to LiteSpeed Enterprise which handles Magento. You also need to install the LiteSpeed plugin to use Magento 2.3 with LiteSpeed.

The issue you’re seeing is a rewrite function to move off the docroot directory to the pub directory.
Follow the Apache instructions here > Modify docroot to improve security | Adobe Commerce Developer Guide
and the error message will be resolved, plus you’re client will have the added security of moving off of docroot.

The error message “Your web server is set up incorrectly and allows unauthorized access to sensitive files” in Magento indicates a security issue. To resolve it:

  1. Check file permissions and ownership.
  2. Secure sensitive files by setting appropriate permissions.
  3. Disable directory browsing.
  4. Review and configure your web server properly.
  5. Update Magento to the latest version.
  6. Check server logs for more information.
  7. Consider finding a hosting provider specializing in Magento if the issue persists.