I am facing a strange issue which started occuring after I upgraded to latest stable version 2.3.2.
Whenever I try to setup a laravel web app, by creating a fresh website using cyberpanel the site starts with cyberpanel installed index.html
But after I remove it and upload the web app files in the root directory and try to open the install wizard or access index it shows me 404 error.
I know this has something to do with htaccess rewrite rules as this is an issue with all new websites we create but previously it got fixed if we saved rewrite rules by manage website page as it added rules generated by cyberpanel by editing htaccess file but now if I do it then starts to show error 403.
In forum previously it had a tutorials section where there was a guide to fix error by editing virtual host config & context from OLS web console but I am unable to find it now.
I would really appreciate any help in this matter. Thanks.
Start by understanding the error 403 Access Denied – You don’t have permission to access.
First ensure the following directories are writable:
chmod -R 777 storage
chmod -R 777 bootstrap/cache
Also check ownership of public folder - directory flags drwxr-x--- ( octal notation 750) and all the files contained (index.php, .htaccess) with directory flags -rw-r--r-- (octal notation 644)
Also scan you server files for malware using ImunifyAV offered via CyberP or whichever malware scanner your hosting provider offers you.
I see you are serving public files from same folder as the application files are in. This is not recommended. To deploy Laravel application you need to separate public folder (served files) from application files.e.g. /home/ cloudride.com/aap for application files, copy all public contents to /home/ cloudride.com/public_html or if its a subdomain move public files to location such as /home/ cloudride.com/public_html/subdomain or /home/ cloudride.com/subdomain
Finally change path of
require __DIR__.’/../bootstrap/autoload.php’; and
$app = require_once __DIR__.’/../bootstrap/app.php’;
to
require __DIR__.’/../aap/bootstrap/autoload.php’; and
$app = require_once __DIR__.’/../aap/bootstrap/app.php’;
Thanks for replying to post, if you check my post again I mentioned it shows error 404 when I create a new website & when I upload contents for the web app to public_html directory first.
Then if I try to use fix permission option in files manager or use the save rewrite rules which inserts the cyberpane rules in htaccess files then it starts to show error 403
You will face a 404 error most of the time in every new website you create using cyberpanel but previously it got fixed by just using fix permission in files manager or just saving the rewrite rules in website manager refer below image.
I previously resolved this kind of issue with help of @qtwrk on old forum of cyberpanel, it’s related to permission setup & can be fixed by editing entries of virtual hosts OLS console but I am unable to find that tutorial link.
I have tried editing the vhost config for the domain and added /public Document Root contexts. Performed a graceful restart but now again I am getting 404 error.