Hi , i have uploaded my php code on : 1. folder /var/www/clients/client1/web1/web/public 2. i have changed owner to web1:client1 on public folder also But why i got forbidden ?
note: i have changed apache directive to change document root like below DocumentRoot "/var/www/clients/client1/web1/web/public"
Why do you have to use public folder since the defaulted web folder is already public? Basically, if you need to hide some other files and/or folders, can put them in parallel with web folder as they will not be accessible by public. Regarding your problem, the best is to check your logs and find what is the cause for such failure to access. Also make sure your php code also log something, if there is any error in it, so you can determine the fault and fix it, if any.
i got error.log as below : [Sat Jan 02 14:01:48.457580 2021] [authz_core:error] [pid 22788] [client 115.178.208.224:47179] AH01630: client denied by server configuration: /var/www/clients/client1/web1/web/public/error.php, referer: http://mariberasuransi.co.id/ [Sat Jan 02 14:01:48.597407 2021] [authz_core:error] [pid 22788] [client 115.178.208.224:47179] AH01630: client denied by server configuration: /var/www/clients/client1/web1/web/public/index.php [Sat Jan 02 14:01:48.687241 2021] [authz_core:error] [pid 22788] [client 115.178.208.224:47179] AH01630: client denied by server configuration: /var/www/clients/client1/web1/web/public/error.php, referer: http://mariberasuransi.co.id/ [Sat Jan 02 14:01:48.777437 2021] [authz_core:error] [pid 22788] [client 115.178.208.224:47179] AH01630: client denied by server configuration: /var/www/clients/client1/web1/web/public/index.php
Please help me, i am stuck with this : i got error.log as below : [Sat Jan 02 14:01:48.457580 2021] [authz_core:error] [pid 22788] [client 115.178.208.224:47179] AH01630: client denied by server configuration: /var/www/clients/client1/web1/web/public/error.php, referer: http://mariberasuransi.co.id/ [Sat Jan 02 14:01:48.597407 2021] [authz_core:error] [pid 22788] [client 115.178.208.224:47179] AH01630: client denied by server configuration: /var/www/clients/client1/web1/web/public/index.php [Sat Jan 02 14:01:48.687241 2021] [authz_core:error] [pid 22788] [client 115.178.208.224:47179] AH01630: client denied by server configuration: /var/www/clients/client1/web1/web/public/error.php, referer: http://mariberasuransi.co.id/ [Sat Jan 02 14:01:48.777437 2021] [authz_core:error] [pid 22788] [client 115.178.208.224:47179] AH01630: client denied by server configuration: /var/www/clients/client1/web1/web/public/index.php
yes. command line like this chown web1:client1 public/ -R working directory on /var/www/clients/client1/web1/web
i have browsed one of the domain , it shows me php code , but another website no problem <?php die('a'); include_once("config/config.php"); include_once("config/init.php");