M
M
MrOnatsky2018-06-23 15:32:20
Apache HTTP Server
MrOnatsky, 2018-06-23 15:32:20

Ubuntu - Apache2 | What rights should be on the site folder?

Good afternoon! Tell me, what rights should the site folder have? For example /mysite/www.
I do like this:

chmod -R 755 /mysite/www
chown -R www-data:www-data /mysite/www

is that enough? Do I need to assign owner and rights recursively? Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2018-06-23
@2ord

Usually put the site in / var / www
Folders should have permissions 775 for user www-data and group www-data.

chmod -R 755 /mysite/www
Recursively set the same permissions for folders and files, which is undesirable.
I would set separate permissions for folders and files:
sudo find /mysite/www -type d -exec chmod -R 775 {} \;
sudo find /mysite/www -type f -exec chmod -R 664 {} \;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question