ajoo Posted May 17, 2017 Share Posted May 17, 2017 (edited) Hi all, Recently I had the bad luck of losing my server as I accidentally and recursively changed the ownership:group of the lib folder to user:user. So I had to reconstruct a new instance of ubuntu and set up the apache server from the scratch. I have done it almost but I notice a few differences / issues that I did not face earlier. One I notice that as mentioned in the title, the files that I upload to the server get the user:group of the server www-data i.e. www-data:www-data. earlier it remained as ubuntu:www-data and the new uploaded files automatically had these settings. Now, like I just pointed out above, the user and group both are apache. I wonder if this is ok and why it not does not remain as ubuntu:www-data. What should be done to ensure that it remains as ubuntu:www-data. Another thing I noticed is that earlier the permissions of my internals folder ( folder outside the web root ) were 710 and it worked great ! But this time I had to change that to 750 before the internals folder could be accessed. I am at a loss to understand this. All my folders have the user:group relation ubuntu:www-data. Any help / pointers is welcome. Thanks all ! Edited May 17, 2017 by ajoo Quote Link to comment https://forums.phpfreaks.com/topic/303952-uploaded-images-get-assigned-usergroup-of-www-datawww-data-by-themselves/ Share on other sites More sharing options...
requinix Posted May 18, 2017 Share Posted May 18, 2017 huh, I never replied to this There are two possible explanations to it, but the second one is much less likely than the first. It could very well be that you had Apache set up to run as the ubuntu user instead of the default www-data. Doing so makes it easier to forget about file permissions and ownership. Personally I don't care for the practice because it increases risk in exchange for laziness. As for the permissions thing, the '1' in 0710 means that users in that group can access the directory, but without also having read or write permission it's hard (but not impossible) to do anything actually useful. 0750 is almost certainly what it should have been. Quote Link to comment https://forums.phpfreaks.com/topic/303952-uploaded-images-get-assigned-usergroup-of-www-datawww-data-by-themselves/#findComment-1546594 Share on other sites More sharing options...
ajoo Posted May 19, 2017 Author Share Posted May 19, 2017 Hi requinix, Thanks loads for the reply. As for the 2nd part of the reply, yes I have for the time being set my permissions to 750. So that removes a part of the problem. The first part, I have not had time to get to it and analyse it. I will and revert soon. Thanks again Quote Link to comment https://forums.phpfreaks.com/topic/303952-uploaded-images-get-assigned-usergroup-of-www-datawww-data-by-themselves/#findComment-1546617 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.