Jump to content

uploaded images get assigned user:group of www-data:www-data by themselves.


ajoo

Recommended Posts

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 by ajoo
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.