Recently I have migrated one of my website in a cPanel server to virtualmin server. My site is having a functionality to upload files to the server. After I migrated the site to virtualmin, uploading is failing. Currently all the files in /home/My_site having permissions My_site:My_site.
Uploading works when I give full permission (777) to the upload folder or giving permission apache:My_site
Please let me know the best approach to keep all the files safe and secure.
Ah, in that case, you would indeed have the problem you’re describing, as the PHP scripts are executed with the permissions of the Apache user, and not the permissions of the Virtual Server administrator.
What I’d suggest is using either CGI, or FCGID, they will run with the permissions of the admin, and not Apache (which is also more secure).