Virtualmin/Webmin anyone?
ardichoke
Icrontian
Just wondering if anyone out there uses Virtualmin or Webmin to manage a webserver. I installed it on my latest webserver, just to play around with. Right now I'm having a hard time figuring out how to get php to run as the user instead of as the webserver user though. I could set this up by hand but I'd prefer it get set globally through Webmin/Virtualmin... just wondering if anyone had any experience with this.
0
Comments
Generally, any time apache serves a php request, it runs as the user that apache runs as. In my case, this is www-data since I'm running a Debian system. This is all well and good if you're just running one site, installed in the default web root and all files and folders are owned by www-data. However I'm running multple vhosts, each one set up as their own user thus I would like php scripts to execute as the user whose vhost it is instead of as www-data. This makes it so you can securely make files writeable to your php scripts. The most common way of doing this is to set up suphp though there are other hackey ways of doing it. I can do this by hand if need be but I want to know how to set it up "properly" in virtualmin/webmin so that when I create a new account it automatically adds the appropriate config to their vhost entry.
1) Making sure all files are owned by group www-data... this really only needs to be done once but still.
2) Any files created by a site are now owned by www-data:www-data which means the owner of the site has no control over them. Currently not a problem since I'm the only one with accounts on the server. If I start hosting some of my friends sites, however, this becomes a problem as they have to contact me to get control over any files created by their sites (uploads, etc.)
So if you have /var/www/websites/bob and /var/www/websties/bill
Only bob and bill would be able to have r/w/e access to the directory. Once you have permission in that directory if it's a www-data group file inside they can access it even if that file is www-data:www-data and not bob:www-data.