G
G
German Zvonchuk2017-04-13 15:09:15
linux
German Zvonchuk, 2017-04-13 15:09:15

How to correctly assign the owner and group of a folder so that the script can upload files?

Good day.
I'm having a problem uploading files using Wordpress.
Wordpress root directory is /home/domain.com/www, it tries to upload files to
/home/domain.com/www/wp-content/uploads.
The owner of the folders and files is the ublog user
Files: 0644
Folders: 0755
The Wordpress script runs under the www-data user.
What needs to be done so that Wordpress scripts can upload files to a folder?
If I give chmod 0777, will any scripts on the server be able to upload files to the uploads folder, even those that do not belong to me?
If I make the owner of the uploads folder of the www-data user, then it turns out that, again, any script running on the server will be able to upload files to the folder?
I would be very grateful if you tell me a safe way out of the situation.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2017-04-13
@saboteur_kiev

And what is the group?
put 664 and 775, and add ublog and www-data to this group, or rather one of them is already exactly in it.
Just in case, read more about umask

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question