for instance, if i am utilizing a php script that creates files, or utilizing a content management systems , the files and folders which are produced are possessed with a special user (f.e. www-data:www-data)

can you really change this default user for special sites? to ensure that for instance all content management systems systems or php scripts generally use another user and group within the dir /httpdocs/somedir?

So far as I understand, It's only possible should you run PHP as CGI (instead of Apache module). For example, FastCGI enables to make use of suexec:

  • Give me an idea related to these special sites?
  • Who/what's going to have the ability to access these sites?
  • What type of special permissions needed?

For instance:

If you wish to access files via FTP which are submitted through the administration panel (www-data) you have to adjust permissions about this folder. You may create a unique group beneath your OS like ftpweb, add your www-data and FTP-user for this group then alter the folders' group for this so both www-data as well as your FTP-user can access.


groupadd ftpweb
usermod www-data -a -G ftpweb
usermod your_ftp_user -a -G ftpweb
chgrp ftpweb your_special_dir