简体   繁体   中英

Apache multiple virtual hosts user permissions

I have webmin installed where I create new virtual hosts and new users to manage those sites.

My process is:

  1. Create a new user. (/home/nameofuser/)
  2. SSH in as the new user, and create a webroot folder (/home/nameofuser/www/)
  3. Create a virtual host pointed to that webroot (home/nameofuser/www/)

The problem with this is that the apache www-data user is not the owner of the files. However, if I let webmin create the webroot for me, the user/group becomes www-data:www-data but the new user is unable to create files/folders.

An example of why this is an issue is when I try to install wordpress, it is unable to install plugins or create files such as log files.

How should I set the permissions on and/or within my webroot folder

In the above scenario the easiest would be to add all users that need access to the folders/files that Webmin created to the www-data group, you may have to give the User directories 664. That should solve access issues, but if the list of users grows so does access to the webroot. A true solution for vhosts and multiple users is apache2-mpm-itk This is a much better solution but requires a little reading.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM