Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 14131  / 1 Year ago, thu, april 27, 2023, 8:59:27

We have a small LAMP server running Ubuntu 12.04 LTS which contains a few sites. Access to the vhosts directories is set to root:AndSpecialSFTPGroup. This works fine in general. However, some of the sites run on a CMS which need write access to particular folders. This is now not working, because the Apache user is www-data.



Simple question: Is OK to add the www-data to the AndSpecialSFTPGroup group in order to grant it rwx permissions. Or is this the wrong approach altogether.



Or should the owner of the website folders be www-data?


More From » 12.04

 Answers
5

There are a few ways you could approach this, but you can add www-data to that group like so:



sudo usermod -a -G AndSpecialSFTPGroup www-data


As far as "Is it the right way to do this?" Like I said, there are many ways to accomplish this, but it's similar to asking me what's the best way to arrange your desk. In many facets of IT, development, and OS, there are choices left up to preference.



This is the way I prefer to handle permissions like this because if I screw something up, I can easily remove the user from the group again. You might like using chown to give all the files to www-data, or something else altogether.



My way is a right way to do this, which is why I most likely won't get flagged for being subjective, but there are other ways. (Like I mentioned chown, create another user, chmod to change the permissions overall, etc...)


[#34456] Friday, April 28, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lassrake

Total Points: 400
Total Questions: 103
Total Answers: 98

Location: Netherlands
Member since Mon, Jun 22, 2020
4 Years ago
;