Submitted by info0 on Wed, 09/19/2012 - 10:08
Is there a script or action in webmin/virtualmin that automatically restores and sets ownerships for users files and folders ?
I am having issues when upgrading certain sites , the fiels and folders is set to "www" as ownership which means I cannot delete these files. Is there a way to on daily basis check and set all folders and files to ownership of that user?
Status:
Active
Comments
Submitted by andreychek on Wed, 09/19/2012 - 10:18 Comment #1
Howdy -- the only time that a file/dir should be owned by the 'www' user is if the Virtual Server has a PHP Execution Mode set to "mod_php".
That's configurable in Server Configuration -> Website Options.
When possible, we'd suggest using CGI or FCGID, which uses suexec. With suexec, the PHP code is executed as the Virtual Server owner, and not as the Apache user.
As for how to fix file and directory permissions -- there is a way to do that from within Virtualmin.
You can do that in Limits and Validation -> Validate Virtual Servers -> Fix Permissions.
I don't believe there's a way to do that from the command line though -- that's something you'd need to manually do from within Virtualmin.
Submitted by info0 on Wed, 09/19/2012 - 10:48 Comment #2
i dont know if it has anything to do with it but i am running nginx upon apache to improve speed is that somethings that would effect changing to CGI or FCGID? Also I assume if switching to suexec it will cause the websites not to work as there is only two CMODs working with this (755 or 644 if not mistaken) ?
Submitted by info0 on Wed, 09/19/2012 - 10:50 Comment #3
The Virtualmin thing "Limits and Validation -> Validate Virtual Servers -> Fix Permissions." was a great option btw.
Submitted by andreychek on Wed, 09/19/2012 - 18:12 Comment #4
Most web apps work with no problem using suexec. It's difficult to say for certain if there would be a problem with your particular app, that's something you'd need to test... but suexec is enabled by default in Virtualmin.
But if you just wanted to run the Fix Permissions thing on occasion using mod_php, that works too :-)